QueryHandler

Trait QueryHandler 

Source
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§

Source

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§

Source

fn query_handler_name(&self) -> &'static str

A unique name for this handler By default, the path to the type is used

Implementors§