Struct UnixListener

struct UnixListener { ... }

A non-blocking Unix domain socket server.

Implementations

impl UnixListener

fn bind<P: AsRef<Path>>(path: P) -> Result<UnixListener>

Creates a new UnixListener bound to the specified socket path.

fn bind_addr(address: &SocketAddr) -> Result<UnixListener>

Creates a new UnixListener bound to the specified socket address.

fn from_std(listener: UnixListener) -> UnixListener

Creates a new UnixListener from a standard net::UnixListener.

This function is intended to be used to wrap a Unix listener from the standard library in the Mio equivalent. The conversion assumes nothing about the underlying listener; it is left up to the user to set it in non-blocking mode.

fn accept(self: &Self) -> Result<(UnixStream, SocketAddr)>

Accepts a new incoming connection to this listener.

The call is responsible for ensuring that the listening socket is in non-blocking mode.

fn local_addr(self: &Self) -> Result<SocketAddr>

Returns the local socket address of this listener.

fn take_error(self: &Self) -> Result<Option<Error>>

Returns the value of the SO_ERROR option.

impl AsFd for UnixListener

fn as_fd(self: &Self) -> BorrowedFd<'_>

impl AsRawFd for UnixListener

fn as_raw_fd(self: &Self) -> RawFd

impl Debug for UnixListener

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Freeze for UnixListener

impl From for UnixListener

fn from(fd: OwnedFd) -> Self

impl FromRawFd for UnixListener

unsafe fn from_raw_fd(fd: RawFd) -> UnixListener

Converts a RawFd to a UnixListener.

Notes

The caller is responsible for ensuring that the socket is in non-blocking mode.

impl IntoRawFd for UnixListener

fn into_raw_fd(self: Self) -> RawFd

impl RefUnwindSafe for UnixListener

impl Send for UnixListener

impl Source for UnixListener

fn register(self: &mut Self, registry: &Registry, token: Token, interests: Interest) -> Result<()>
fn reregister(self: &mut Self, registry: &Registry, token: Token, interests: Interest) -> Result<()>
fn deregister(self: &mut Self, registry: &Registry) -> Result<()>

impl Sync for UnixListener

impl Unpin for UnixListener

impl UnsafeUnpin for UnixListener

impl UnwindSafe for UnixListener

impl<T> Any for UnixListener

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for UnixListener

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for UnixListener

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for UnixListener

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for UnixListener

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for UnixListener

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for UnixListener

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>