Trait pal_async::socket::Listener

source ·
pub trait Listener: AsSockRef {
    type Socket: AsSockRef + Read + Write + Into<Socket>;
    type Address: Debug;

    // Required methods
    fn accept(&self) -> Result<(Self::Socket, Self::Address)>;
    fn local_addr(&self) -> Result<Self::Address>;
}
Expand description

Trait for listening sockets.

Required Associated Types§

source

type Socket: AsSockRef + Read + Write + Into<Socket>

The socket type.

source

type Address: Debug

The socket address type.

Required Methods§

source

fn accept(&self) -> Result<(Self::Socket, Self::Address)>

Accepts an incoming socket.

source

fn local_addr(&self) -> Result<Self::Address>

Returns the local address of the listener.

Implementations on Foreign Types§

source§

impl Listener for TcpListener

source§

impl Listener for UnixListener

source§

impl Listener for Socket

source§

type Socket = Socket

source§

type Address = SockAddr

source§

fn accept(&self) -> Result<(Self::Socket, Self::Address)>

source§

fn local_addr(&self) -> Result<Self::Address>

source§

impl<'a, T> Listener for &'a T

source§

type Socket = <T as Listener>::Socket

source§

type Address = <T as Listener>::Address

source§

fn accept(&self) -> Result<(Self::Socket, Self::Address)>

source§

fn local_addr(&self) -> Result<Self::Address>

Implementors§