Struct Domain
pub struct Domain(/* private field */);
Specification of the communication domain for a socket.
This is a newtype wrapper around an integer which provides a nicer API in
addition to an injection point for documentation. Convenience constants such
as Domain::IPV4, Domain::IPV6, etc, are provided to avoid reaching
into libc for various constants.
This type is freely interconvertible with C's int type, however, if a raw
value needs to be provided.
Implementations
impl Domain
const IPV4: Domain = _;Domain for IPv4 communication, corresponding to
AF_INET.const IPV6: Domain = _;Domain for IPv6 communication, corresponding to
AF_INET6.const UNIX: Domain = _;Domain for Unix socket communication, corresponding to
AF_UNIX.const fn for_address(address: SocketAddr) -> DomainReturns the correct domain for
address.
impl Domain
const PACKET: Domain = _;Domain for low-level packet interface, corresponding to
AF_PACKET.const VSOCK: Domain = _;Domain for low-level VSOCK interface, corresponding to
AF_VSOCK.
Trait Implementations
impl Clone for Domain
fn clone(&self) -> Self
impl Copy for Domain
impl Debug for Domain
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Domain
impl From<i32> for Domain
fn from(d: c_int) -> Domain
impl PartialEq for Domain
fn eq(&self, other: &Self) -> bool