Trait Listener

trait Listener: Send + 'static

Types that can listen for connections.

Associated Types

type Io: TraitBound { trait_: Path { path: "AsyncRead", id: Id(4195), args: None }, generic_params: [], modifier: None } + TraitBound { trait_: Path { path: "AsyncWrite", id: Id(4196), args: None }, generic_params: [], modifier: None } + TraitBound { trait_: Path { path: "Unpin", id: Id(13), args: None }, generic_params: [], modifier: None } + TraitBound { trait_: Path { path: "Send", id: Id(5), args: None }, generic_params: [], modifier: None } + Outlives("'static")

The listener's IO type.

type Addr: TraitBound { trait_: Path { path: "Send", id: Id(5), args: None }, generic_params: [], modifier: None }

The listener's address type.

Required Methods

fn accept(self: &mut Self) -> impl Future<Output = (<Self as >::Io, <Self as >::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: &Self) -> Result<<Self as >::Addr>

Returns the local address that this listener is bound to.

Implementors