Trait RequestHandler

Source
pub trait RequestHandler:
    Send
    + Sync
    + Unpin
    + 'static {
    // Required method
    fn handle_request<'life0, 'life1, 'async_trait, R>(
        &'life0 self,
        request: &'life1 Request,
        response_handle: R,
    ) -> Pin<Box<dyn Future<Output = ResponseInfo> + Send + 'async_trait>>
       where R: 'async_trait + ResponseHandler,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for handling incoming requests, and providing a message response.

Required Methods§

Source

fn handle_request<'life0, 'life1, 'async_trait, R>( &'life0 self, request: &'life1 Request, response_handle: R, ) -> Pin<Box<dyn Future<Output = ResponseInfo> + Send + 'async_trait>>
where R: 'async_trait + ResponseHandler, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Determines what needs to happen given the type of request, i.e. Query or Update.

§Arguments
  • request - the requested action to perform.
  • response_handle - handle to which a return message should be sent

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§