Skip to main content

QueryDispatcher

Trait QueryDispatcher 

Source
pub trait QueryDispatcher: Send + Sync {
    // Required method
    fn dispatch<'life0, 'async_trait, Q>(
        &'life0 self,
        query: Q,
    ) -> Pin<Box<dyn Future<Output = Result<Q::Result, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Q: 'async_trait + Query,
             Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Query dispatcher for routing queries to their handlers.

Provides a central point for query execution with optional caching and middleware support.

Required Methods§

Source

fn dispatch<'life0, 'async_trait, Q>( &'life0 self, query: Q, ) -> Pin<Box<dyn Future<Output = Result<Q::Result, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Q: 'async_trait + Query, Self: 'async_trait, 'life0: 'async_trait,

Dispatch a query to its handler.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§