Struct mio::net::UnixListener
source · pub struct UnixListener {
inner: IoSource<UnixListener>,
}
Expand description
A non-blocking Unix domain socket server.
Fields§
§inner: IoSource<UnixListener>
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 path
.
sourcepub fn bind_addr(address: &SocketAddr) -> Result<UnixListener>
pub fn bind_addr(address: &SocketAddr) -> Result<UnixListener>
Creates a new UnixListener
bound to the specified socket address
.
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 AsFd for UnixListener
impl AsFd for UnixListener
source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
source§impl AsRawFd for UnixListener
impl AsRawFd for UnixListener
source§impl Debug for UnixListener
impl Debug for UnixListener
source§impl From<UnixListener> for UnixListener
impl From<UnixListener> for UnixListener
source§fn from(listener: UnixListener) -> Self
fn from(listener: UnixListener) -> Self
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.