Service

Trait Service 

Source
pub trait Service:
    Send
    + Sync
    + 'static {
    // Required method
    fn handle(
        &self,
        req: Request,
        stream: Option<TcpStream>,
    ) -> Result<ServiceResult>;
}
Expand description

The trait representing the user’s core application logic.

Required Methods§

Source

fn handle( &self, req: Request, stream: Option<TcpStream>, ) -> Result<ServiceResult>

Handles an incoming request, receiving the Request and the underlying stream. The stream is passed as an Option to allow the service to consume it for upgrades.

Implementors§