pub trait HttpService: Clone + Send + Sync + 'static {
    // Required method
    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 'life0: 'async_trait,
             'life1: 'async_trait,
             S: 'async_trait + AsyncRead + AsyncWrite + Unpin + Send + 'static,
             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§

source

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 'life0: 'async_trait, 'life1: 'async_trait, S: 'async_trait + AsyncRead + AsyncWrite + Unpin + Send + 'static, Self: 'async_trait,

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl HttpService for ()

source§

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 'life0: 'async_trait, 'life1: 'async_trait, S: 'async_trait + AsyncRead + AsyncWrite + Unpin + Send + 'static, (): 'async_trait,

Implementors§