Struct mio::net::UnixListener
source · [−]pub struct UnixListener { /* private fields */ }
Expand description
A non-blocking Unix domain socket server.
Implementations
sourceimpl UnixListener
impl UnixListener
sourcepub fn bind<P: AsRef<Path>>(path: P) -> Result<UnixListener>
pub fn bind<P: AsRef<Path>>(path: P) -> Result<UnixListener>
Creates a new UnixListener
bound to the specified socket.
sourcepub fn from_std(listener: UnixListener) -> UnixListener
pub 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.
sourcepub fn accept(&self) -> Result<(UnixStream, SocketAddr)>
pub fn accept(&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.
sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Returns the local socket address of this listener.
sourcepub fn take_error(&self) -> Result<Option<Error>>
pub fn take_error(&self) -> Result<Option<Error>>
Returns the value of the SO_ERROR
option.
Trait Implementations
sourceimpl AsRawFd for UnixListener
impl AsRawFd for UnixListener
sourceimpl Debug for UnixListener
impl Debug for UnixListener
sourceimpl FromRawFd for UnixListener
impl FromRawFd for UnixListener
sourceunsafe fn from_raw_fd(fd: RawFd) -> 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.
sourceimpl IntoRawFd for UnixListener
impl IntoRawFd for UnixListener
sourcefn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. Read more
sourceimpl Source for UnixListener
impl Source for UnixListener
sourcefn register(
&mut self,
registry: &Registry,
token: Token,
interests: Interest
) -> Result<()>
fn register(
&mut self,
registry: &Registry,
token: Token,
interests: Interest
) -> Result<()>
Register self
with the given Registry
instance. Read more
Auto Trait Implementations
impl RefUnwindSafe for UnixListener
impl Send for UnixListener
impl Sync for UnixListener
impl Unpin for UnixListener
impl UnwindSafe for UnixListener
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more