Trait webrtc_util::conn::Listener

source ·
pub trait Listener {
    // Required methods
    fn accept<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(Arc<dyn Conn + Send + Sync>, SocketAddr)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn close<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn addr<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<SocketAddr>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A Listener is a generic network listener for connection-oriented protocols. Multiple connections may invoke methods on a Listener simultaneously.

Required Methods§

source

fn accept<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(Arc<dyn Conn + Send + Sync>, SocketAddr)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

accept waits for and returns the next connection to the listener.

source

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

close closes the listener. Any blocked accept operations will be unblocked and return errors.

source

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

addr returns the listener’s network address.

Implementors§