Struct cap_std::os::unix::net::UnixListener[][src]

pub struct UnixListener { /* fields omitted */ }

A structure representing a Unix domain socket server.

This corresponds to std::os::unix::net::UnixListener.

Note that this UnixListener has no bind method. To bind it to a socket address, you must first obtain a Dir containing the path, and then call Dir::bind_unix_listener.

Implementations

impl UnixListener[src]

pub unsafe fn from_std(std: UnixListener) -> Self[src]

Constructs a new instance of Self from the given std::os::unix::net::UnixListener.

Safety

std::os::unix::net::UnixListener is not sandboxed and may access any address that the host process has access to.

pub fn accept(&self) -> Result<(UnixStream, SocketAddr)>[src]

Accepts a new incoming connection to this listener.

This corresponds to std::os::unix::net::UnixListener::accept.

pub fn try_clone(&self) -> Result<Self>[src]

Creates a new independently owned handle to the underlying socket.

This corresponds to std::os::unix::net::UnixListener::try_clone.

pub fn local_addr(&self) -> Result<SocketAddr>[src]

Returns the local socket address of this listener.

This corresponds to std::os::unix::net::UnixListener::local_addr.

pub fn set_nonblocking(&self, nonblocking: bool) -> Result<()>[src]

Moves the socket into or out of nonblocking mode.

This corresponds to std::os::unix::net::UnixListener::set_nonblocking.

pub fn take_error(&self) -> Result<Option<Error>>[src]

Returns the value of the SO_ERROR option.

This corresponds to std::os::unix::net::UnixListener::take_error.

pub fn incoming(&self) -> Incoming<'_>

Notable traits for Incoming<'a>

impl<'a> Iterator for Incoming<'a> type Item = Result<UnixStream>;
[src]

Returns an iterator over incoming connections.

This corresponds to std::os::unix::net::UnixListener::incoming.

Trait Implementations

impl AsRawFd for UnixListener[src]

impl FromRawFd for UnixListener[src]

impl<'a> IntoIterator for &'a UnixListener[src]

type IntoIter = Incoming<'a>

Which kind of iterator are we turning this into?

type Item = Result<UnixStream>

The type of the elements being iterated over.

impl IntoRawFd for UnixListener[src]

impl OwnsRaw for UnixListener[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> AsUnsafeFile for T where
    T: OwnsRaw + AsRawFd
[src]

impl<T> AsUnsafeHandle for T where
    T: OwnsRaw + AsRawFd
[src]

impl<T> AsUnsafeSocket for T where
    T: OwnsRaw + AsRawFd
[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> FromUnsafeFile for T where
    T: OwnsRaw + FromRawFd
[src]

impl<T> FromUnsafeSocket for T where
    T: OwnsRaw + FromRawFd
[src]

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

impl<T> IntoUnsafeFile for T where
    T: OwnsRaw + IntoRawFd
[src]

impl<T> IntoUnsafeHandle for T where
    T: OwnsRaw + IntoRawFd
[src]

impl<T> IntoUnsafeSocket for T where
    T: OwnsRaw + IntoRawFd
[src]

impl<T> SetTimes for T where
    T: AsRawFd

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.