Trait uds::UnixListenerExt
source · pub trait UnixListenerExt: AsRawFd + FromRawFd {
type Conn: FromRawFd;
// Required methods
fn bind_unix_addr(on: &UnixSocketAddr) -> Result<Self, Error>
where Self: Sized;
fn accept_unix_addr(&self) -> Result<(Self::Conn, UnixSocketAddr), Error>;
// Provided method
fn local_unix_addr(&self) -> Result<UnixSocketAddr, Error> { ... }
}
Expand description
Extension trait for using UnixSocketAddr
with UnixListener
types.
Required Associated Types§
Required Methods§
sourcefn bind_unix_addr(on: &UnixSocketAddr) -> Result<Self, Error>where
Self: Sized,
fn bind_unix_addr(on: &UnixSocketAddr) -> Result<Self, Error>where
Self: Sized,
Creates a socket bound to a UnixSocketAddr
and starts listening on it.
sourcefn accept_unix_addr(&self) -> Result<(Self::Conn, UnixSocketAddr), Error>
fn accept_unix_addr(&self) -> Result<(Self::Conn, UnixSocketAddr), Error>
Accepts a connection and returns the client’s address as
an uds::UnixSocketAddr
.
Provided Methods§
sourcefn local_unix_addr(&self) -> Result<UnixSocketAddr, Error>
fn local_unix_addr(&self) -> Result<UnixSocketAddr, Error>
Returns the address this socket is listening on.
Object Safety§
This trait is not object safe.