pub struct IpcListener { /* private fields */ }Expand description
A bound Unix domain socket listener that unlinks its socket file on drop.
A UnixListener does not remove its filesystem node when closed, so every
IPC endpoint would otherwise leave a stale socket behind (libzmq unlinks the
endpoint on close). This wrapper records the bound path and removes it on
Drop, guarding the unlink so it only ever removes a socket node.
It Derefs to the underlying UnixListener, so it can be used anywhere
a &UnixListener is expected (e.g. accept).
Implementations§
Source§impl IpcListener
impl IpcListener
Methods from Deref<Target = UnixListener>§
Sourcepub async fn accept(&self) -> Result<(UnixStream, SockAddr), Error>
pub async fn accept(&self) -> Result<(UnixStream, SockAddr), Error>
Accepts a new incoming connection from this listener.
This function will yield once a new Unix domain socket connection
is established. When established, the corresponding UnixStream and
the remote peer’s address will be returned.
Sourcepub fn incoming(&self) -> UnixIncoming<'_>
pub fn incoming(&self) -> UnixIncoming<'_>
Returns a stream of incoming connections to this listener.
Sourcepub fn local_addr(&self) -> Result<SockAddr, Error>
pub fn local_addr(&self) -> Result<SockAddr, Error>
Returns the local address that this listener is bound to.
Trait Implementations§
Source§impl Debug for IpcListener
impl Debug for IpcListener
Source§impl Deref for IpcListener
Available on Unix only.
impl Deref for IpcListener
Source§type Target = UnixListener
type Target = UnixListener
Source§impl Drop for IpcListener
Available on Unix only.
impl Drop for IpcListener
Auto Trait Implementations§
impl !Freeze for IpcListener
impl !RefUnwindSafe for IpcListener
impl !Send for IpcListener
impl !Sync for IpcListener
impl Unpin for IpcListener
impl UnsafeUnpin for IpcListener
impl UnwindSafe for IpcListener
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more