Struct socket2::Domain
[−]
[src]
pub struct Domain(_);
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 constructors
such as Domain::ipv4, Domain::ipv6, etc, are provided to avoid reaching
into libc for various constants.
This type is freely interconvertible with the i32 type, however, if a raw
value needs to be provided.
Methods
impl Domain[src]
pub fn ipv4() -> Domain[src]
Domain for IPv4 communication, corresponding to AF_INET.
pub fn ipv6() -> Domain[src]
Domain for IPv6 communication, corresponding to AF_INET6.
pub fn unix() -> Domain[src]
Domain for Unix socket communication, corresponding to AF_UNIX.
This function is only available on Unix when the unix feature is
activated.