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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.