pub trait RequestHandler:
Send
+ Sync
+ Unpin
+ 'static {
// Required method
fn handle_request<'life0, 'life1, 'async_trait, R, T>(
&'life0 self,
request: &'life1 Request,
response_handle: R,
) -> Pin<Box<dyn Future<Output = ResponseInfo> + Send + 'async_trait>>
where R: 'async_trait + ResponseHandler,
T: 'async_trait + Time,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Trait for handling incoming requests, and providing a message response.
Required Methods§
Sourcefn handle_request<'life0, 'life1, 'async_trait, R, T>(
&'life0 self,
request: &'life1 Request,
response_handle: R,
) -> Pin<Box<dyn Future<Output = ResponseInfo> + Send + 'async_trait>>where
R: 'async_trait + ResponseHandler,
T: 'async_trait + Time,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_request<'life0, 'life1, 'async_trait, R, T>(
&'life0 self,
request: &'life1 Request,
response_handle: R,
) -> Pin<Box<dyn Future<Output = ResponseInfo> + Send + 'async_trait>>where
R: 'async_trait + ResponseHandler,
T: 'async_trait + Time,
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".