Skip to main content

AsyncAcceptor

Trait AsyncAcceptor 

Source
pub(super) trait AsyncAcceptor: Send + Sync {
    // Required methods
    fn accept<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn ByteStream>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn handle<'life0, 'life1, 'async_trait>(
        &'life0 self,
        stream: Box<dyn ByteStream>,
        server: &'life1 Arc<Server>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn local_endpoint(&self) -> Result<Endpoint>;
}
Expand description

Accepts raw streams and upgrades/handles them.

Required Methods§

Source

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

Kernel accept only, before any handshake.

Source

fn handle<'life0, 'life1, 'async_trait>( &'life0 self, stream: Box<dyn ByteStream>, server: &'life1 Arc<Server>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Upgrade the stream, frame it, and hand it to the server.

Source

fn local_endpoint(&self) -> Result<Endpoint>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§