pub trait Listener {
    type Connection: Splittable + 'static;
    type Error: Display;

    // Required method
    fn accept<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Accepts new connections. Usually will be created listening on a specific interface and this is just the result.

Required Associated Types§

Required Methods§

source

fn accept<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the next incoming connection.

Implementations on Foreign Types§

source§

impl Listener for TcpListener

§

type Connection = TcpStream

§

type Error = Error

source§

fn accept<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§