Skip to main content

HttpAcceptor

Trait HttpAcceptor 

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

Runs an HTTP server. Hides the codec type, like AsyncAcceptor does for the stream transports.

Required Methods§

Source

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

Run the accept loop.

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§