pub struct UnixListener { /* private fields */ }
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 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.
Source§impl IntoRawFd for UnixListener
impl IntoRawFd for UnixListener
Source§fn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Auto Trait Implementations§
impl !Freeze for UnixListener
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes