Trait bonsaidb_server::TcpService[][src]

pub trait TcpService: Clone + Send + Sync + 'static {
    type ApplicationProtocols: ApplicationProtocols;
    fn available_protocols(&self) -> &[Self::ApplicationProtocols];
fn handle_connection<'life0, 'life1, 'async_trait, S>(
        &'life0 self,
        connection: S,
        peer: &'life1 Peer<Self::ApplicationProtocols>
    ) -> 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 TCP connections.

Associated Types

The application layer protocols that this service supports.

Required methods

Returns all available protocols for this service. The first will be the default used if a connection is made without negotiating the application protocol.

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

Implementors