Struct mio::net::UnixListener
source · pub struct UnixListener { /* private fields */ }
Available on crate feature
net
only.Expand description
A non-blocking Unix domain socket server.
Implementations§
source§impl 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§
source§impl AsRawFd for UnixListener
impl AsRawFd for UnixListener
source§impl Debug for UnixListener
impl Debug for UnixListener
source§impl FromRawFd for UnixListener
impl FromRawFd for UnixListener
source§unsafe 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.
source§impl IntoRawFd for UnixListener
impl IntoRawFd for UnixListener
source§fn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. 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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more