Trait Listener

pub trait Listener: Send + 'static

Types that can listen for connections.

Associated Types

type Io: AsyncRead + AsyncWrite + Unpin + Send + 'static;

The listener's IO type.

type Addr: Send;

The listener's address type.

Required Methods

fn accept(&mut self) -> impl Future<Output = (Self::Io, Self::Addr)> + Send

Accept a new incoming connection to this listener.

If the underlying accept call can return an error, this function must take care of logging and retrying.

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

Returns the local address that this listener is bound to.

Implementors