Enum rustix::net::SocketAddrAny
source · #[non_exhaustive]pub enum SocketAddrAny {
V4(SocketAddrV4),
V6(SocketAddrV6),
Unix(SocketAddrUnix),
Xdp(SocketAddrXdp),
}
Expand description
struct sockaddr_storage
as a Rust enum.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
V4(SocketAddrV4)
struct sockaddr_in
V6(SocketAddrV6)
struct sockaddr_in6
Unix(SocketAddrUnix)
struct sockaddr_un
Xdp(SocketAddrXdp)
struct sockaddr_xdp
Implementations§
source§impl SocketAddrAny
impl SocketAddrAny
sourcepub const fn address_family(&self) -> AddressFamily
pub const fn address_family(&self) -> AddressFamily
Return the address family of this socket address.
Trait Implementations§
source§impl Clone for SocketAddrAny
impl Clone for SocketAddrAny
source§fn clone(&self) -> SocketAddrAny
fn clone(&self) -> SocketAddrAny
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SocketAddrAny
impl Debug for SocketAddrAny
source§impl From<SocketAddr> for SocketAddrAny
impl From<SocketAddr> for SocketAddrAny
source§fn from(from: SocketAddr) -> Self
fn from(from: SocketAddr) -> Self
Converts to this type from the input type.
source§impl From<SocketAddrUnix> for SocketAddrAny
impl From<SocketAddrUnix> for SocketAddrAny
source§fn from(from: SocketAddrUnix) -> Self
fn from(from: SocketAddrUnix) -> Self
Converts to this type from the input type.
source§impl From<SocketAddrV4> for SocketAddrAny
impl From<SocketAddrV4> for SocketAddrAny
source§fn from(from: SocketAddrV4) -> Self
fn from(from: SocketAddrV4) -> Self
Converts to this type from the input type.
source§impl From<SocketAddrV6> for SocketAddrAny
impl From<SocketAddrV6> for SocketAddrAny
source§fn from(from: SocketAddrV6) -> Self
fn from(from: SocketAddrV6) -> Self
Converts to this type from the input type.
source§impl Hash for SocketAddrAny
impl Hash for SocketAddrAny
source§impl Ord for SocketAddrAny
impl Ord for SocketAddrAny
source§fn cmp(&self, other: &SocketAddrAny) -> Ordering
fn cmp(&self, other: &SocketAddrAny) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for SocketAddrAny
impl PartialEq for SocketAddrAny
source§impl PartialOrd for SocketAddrAny
impl PartialOrd for SocketAddrAny
impl Eq for SocketAddrAny
impl StructuralPartialEq for SocketAddrAny
Auto Trait Implementations§
impl Freeze for SocketAddrAny
impl RefUnwindSafe for SocketAddrAny
impl Send for SocketAddrAny
impl Sync for SocketAddrAny
impl Unpin for SocketAddrAny
impl UnwindSafe for SocketAddrAny
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)