#[non_exhaustive]#[repr(i32)]pub enum AddressFamily {
Unix = 1,
Inet = 2,
Inet6 = 10,
Packet = 17,
Ipx = 4,
AppleTalk = 5,
Decnet = 12,
Sna = 22,
Bluetooth = 31,
Isdn = 34,
}
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
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.
Unix = 1
Local communication (see unix(7)
)
Inet = 2
IPv4 Internet protocols (see ip(7)
)
Inet6 = 10
IPv6 Internet protocols (see ipv6(7)
)
Packet = 17
Low level packet interface (see packet(7)
)
Ipx = 4
IPX - Novell protocols
AppleTalk = 5
AppleTalk
Decnet = 12
DECet protocol sockets.
Sna = 22
IBM SNA
Bluetooth = 31
Bluetooth low-level socket protocol
Isdn = 34
New “modular ISDN” driver interface protocol
Implementations§
Source§impl 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§
Source§impl Clone for AddressFamily
impl Clone for AddressFamily
Source§fn clone(&self) -> AddressFamily
fn clone(&self) -> AddressFamily
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 AddressFamily
impl Debug for AddressFamily
Source§impl Hash for AddressFamily
impl Hash for AddressFamily
Source§impl PartialEq for AddressFamily
impl PartialEq for AddressFamily
impl Copy for AddressFamily
impl Eq for AddressFamily
impl StructuralPartialEq for AddressFamily
Auto Trait Implementations§
impl Freeze for AddressFamily
impl RefUnwindSafe for AddressFamily
impl Send for AddressFamily
impl Sync for AddressFamily
impl Unpin for AddressFamily
impl UnwindSafe for AddressFamily
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
)