pub trait HttpService: 'static + Clone + Send + Sync {
    fn handle_connection<'life0, 'life1, 'async_trait, S>(
        &'life0 self,
        connection: S,
        peer: &'life1 Peer<StandardTcpProtocols>
    ) -> Pin<Box<dyn Future<Output = Result<(), S>> + Send + 'async_trait, Global>>
        'life0: 'async_trait,
        'life1: 'async_trait,
        S: 'async_trait + 'static + AsyncRead + AsyncWrite + Unpin + Send,
        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§