Service

Trait Service 

Source
pub trait Service: Send + Sync {
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn run<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

A service that handles a specific type of connection

Services are created by a ServiceRouter and run independently to handle bi-directional streams from authenticated clients.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

The error type returned by this service

Required Methods§

Source

fn run<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Run the service with the provided streams

This method will be called in its own task and should handle the bi-directional communication with the client.

Implementors§