#[repr(i32)]
#[non_exhaustive]
pub enum AddressFamily {
Unix,
Inet,
Inet6,
Packet,
Ipx,
AppleTalk,
Decnet,
Sna,
Link,
}
socket
only.Expand description
These constants specify the protocol family to be used
in socket
and socketpair
References
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Unix
Local communication (see unix(7)
)
Inet
IPv4 Internet protocols (see ip(7)
)
Inet6
IPv6 Internet protocols (see ipv6(7)
)
Packet
Low level packet interface (see packet(7)
)
Ipx
IPX - Novell protocols
AppleTalk
AppleTalk
Decnet
DECet protocol sockets.
Sna
IBM SNA
Link
Link layer interface
Implementations
sourceimpl AddressFamily
impl AddressFamily
sourcepub const fn from_i32(family: i32) -> Option<AddressFamily>
pub const fn from_i32(family: i32) -> Option<AddressFamily>
Create a new AddressFamily
from an integer value retrieved from libc
, usually from
the sa_family
field of a sockaddr
.
Currently only supports these address families: Unix, Inet (v4 & v6), Netlink, Link/Packet and System. Returns None for unsupported or unknown address families.
Trait Implementations
sourceimpl Clone for AddressFamily
impl Clone for AddressFamily
sourcefn clone(&self) -> AddressFamily
fn clone(&self) -> AddressFamily
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for AddressFamily
impl Debug for AddressFamily
sourceimpl Hash for AddressFamily
impl Hash for AddressFamily
sourceimpl PartialEq<AddressFamily> for AddressFamily
impl PartialEq<AddressFamily> for AddressFamily
impl Copy for AddressFamily
impl Eq for AddressFamily
impl StructuralEq for AddressFamily
impl StructuralPartialEq for AddressFamily
Auto Trait Implementations
impl RefUnwindSafe for AddressFamily
impl Send for AddressFamily
impl Sync for AddressFamily
impl Unpin for AddressFamily
impl UnwindSafe for AddressFamily
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more