pub trait QueryHandler: Send + Sync {
// Required method
fn handle_query<'life0, 'async_trait>(
&'life0 self,
dispatched: DispatchedQuery,
) -> Pin<Box<dyn Future<Output = DispatchedQuery> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn query_handler_name(&self) -> &'static str { ... }
}Expand description
A query’s handler must implement this trait
Required Methods§
Sourcefn handle_query<'life0, 'async_trait>(
&'life0 self,
dispatched: DispatchedQuery,
) -> Pin<Box<dyn Future<Output = DispatchedQuery> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_query<'life0, 'async_trait>(
&'life0 self,
dispatched: DispatchedQuery,
) -> Pin<Box<dyn Future<Output = DispatchedQuery> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
This method is call to handle the dispatched query
Provided Methods§
Sourcefn query_handler_name(&self) -> &'static str
fn query_handler_name(&self) -> &'static str
A unique name for this handler By default, the path to the type is used