pub struct UnixListener { /* private fields */ }
Expand description
A non-blocking Unix domain socket server with support for passing RawFd
.
Implementations§
Source§impl UnixListener
impl UnixListener
Sourcepub fn bind(path: impl AsRef<Path>) -> Result<UnixListener>
pub fn bind(path: impl AsRef<Path>) -> Result<UnixListener>
Creates a new UnixListener
bound to the specific path.
The listener will be set to 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 returned stream will be set to non-blocking mode.
Sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Returns the local socket address for 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 Evented for UnixListener
impl Evented for UnixListener
Source§impl FromRawFd for UnixListener
Create a UnixListener
from a RawFd
.
impl FromRawFd for UnixListener
Create a UnixListener
from a RawFd
.
This does not change the RawFd
into non-blocking mode. It assumes that any such
required change has already been done.
Source§unsafe fn from_raw_fd(fd: RawFd) -> Self
unsafe fn from_raw_fd(fd: RawFd) -> Self
Constructs a new instance of
Self
from the given raw file
descriptor. Read moreSource§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
Source§impl TryFrom<UnixListener> for UnixListener
impl TryFrom<UnixListener> for UnixListener
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
Mutably borrows from an owned value. Read more