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 C’s int type, however, if a raw value needs to be provided.

Implementations

impl Domain[src]

Unix only API.

pub fn unix() -> Domain[src]

Domain for Unix socket communication, corresponding to AF_UNIX.

pub fn packet() -> Domain[src]

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

Notes

This function is only available on Linux.

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.

Trait Implementations

impl Clone for Domain[src]

impl Copy for Domain[src]

impl Debug for Domain[src]

impl From<Domain> for c_int[src]

impl From<i32> for Domain[src]

Auto Trait Implementations

impl RefUnwindSafe for Domain

impl Send for Domain

impl Sync for Domain

impl Unpin for Domain

impl UnwindSafe for Domain

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.