Trait bonsaidb_server::HttpService[][src]

pub trait HttpService: Clone + Send + Sync + 'static {
    fn handle_connection<'life0, 'life1, 'async_trait, S>(
        &'life0 self,
        connection: S,
        peer: &'life1 Peer
    ) -> Pin<Box<dyn Future<Output = Result<(), S>> + Send + 'async_trait>>
    where
        S: 'async_trait + AsyncRead + AsyncWrite + Unpin + Send + 'static,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }
Expand description

A service that can handle incoming HTTP connections. A convenience implementation of TcpService that is useful is you are only serving HTTP and WebSockets over a service.

Required methods

Handle an incoming connection for peer. Return Err(connection) to have BonsaiDb handle the connection internally.

Implementations on Foreign Types

Implementors