pub trait AsLairServer: 'static + Send + Sync {
    // Required methods
    fn accept(
        &self,
        send: Box<dyn AsyncWrite + Send + Unpin>,
        recv: Box<dyn AsyncRead + Send + Unpin>
    ) -> Pin<Box<dyn Future<Output = Result<(), OneErr>> + Send>>;
    fn store(
        &self
    ) -> Pin<Box<dyn Future<Output = Result<LairStore, OneErr>> + Send>>;
}
Expand description

Object-safe lair server trait. Implement this to provide a new lair server backend implementation.

Required Methods§

fn accept( &self, send: Box<dyn AsyncWrite + Send + Unpin>, recv: Box<dyn AsyncRead + Send + Unpin> ) -> Pin<Box<dyn Future<Output = Result<(), OneErr>> + Send>>

accept an incoming connection, servicing the lair protocol.

fn store( &self ) -> Pin<Box<dyn Future<Output = Result<LairStore, OneErr>> + Send>>

get a handle to the LairStore instantiated by this server, may error if a store has not yet been created.

Implementors§