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§

source

type Conn: FromRawFd

The type represeting the stream connection returned by accept_unix_addr().

Required Methods§

source

fn bind_unix_addr(on: &UnixSocketAddr) -> Result<Self, Error>
where Self: Sized,

Creates a socket bound to a UnixSocketAddr and starts listening on it.

source

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§

source

fn local_unix_addr(&self) -> Result<UnixSocketAddr, Error>

Returns the address this socket is listening on.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl UnixListenerExt for UnixListener

source§

impl UnixListenerExt for UnixListener

Implementors§