Skip to main content

TransportListener

Trait TransportListener 

Source
pub trait TransportListener:
    Send
    + Sync
    + 'static {
    // Required methods
    fn accept<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(Box<dyn MeshStream>, SocketAddr), MeshError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn local_addr(&self) -> Result<SocketAddr, MeshError>;
}
Expand description

Listens for incoming mesh connections.

Required Methods§

Source

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

Accept the next incoming connection.

Source

fn local_addr(&self) -> Result<SocketAddr, MeshError>

Get the local address this listener is bound to.

Implementors§