pub trait QueryHandler<Q: Query>: Send + Sync {
type Error: Error + Send + Sync;
// Required method
fn handle<'life0, 'async_trait>(
&'life0 self,
query: Q,
) -> Pin<Box<dyn Future<Output = Result<Q::Result, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Handler for executing queries.
Query handlers retrieve data from read models and should be optimized for read performance.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".