[][src]Struct socket2::Domain

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 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[src]

Unix only API.

pub const UNIX: Domain[src]

Domain for Unix socket communication, corresponding to AF_UNIX.

pub const PACKET: Domain[src]

Domain for low-level packet interface, corresponding to AF_PACKET.

Notes

This function is only available on Fuchsia and Linux.

pub const VSOCK: Domain[src]

Domain for low-level VSOCK interface, corresponding to AF_VSOCK.

Notes

This function is only available on Linux.

impl Domain[src]

pub const IPV4: Domain[src]

Domain for IPv4 communication, corresponding to AF_INET.

pub const IPV6: Domain[src]

Domain for IPv6 communication, corresponding to AF_INET6.

pub const fn for_address(address: SocketAddr) -> Domain[src]

Returns the correct domain for address.

Trait Implementations

impl Clone for Domain[src]

impl Copy for Domain[src]

impl Debug for Domain[src]

impl Eq for Domain[src]

impl From<i32> for Domain[src]

impl PartialEq<Domain> for Domain[src]

impl StructuralEq for Domain[src]

impl StructuralPartialEq for Domain[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.