pub struct QueryHandlerManager { /* private fields */ }Expand description
Query Handle Manager Manges the middlewares that will be call before the handler
Implementations§
Source§impl QueryHandlerManager
impl QueryHandlerManager
Sourcepub async fn new(handler: impl QueryHandler + 'static) -> Self
pub async fn new(handler: impl QueryHandler + 'static) -> Self
Creates a new instance
Sourcepub async fn next<M>(&self, middleware: M) -> &Selfwhere
M: FnMut(DispatchedQuery, NextQueryMiddleware) -> BoxFuture<'static, DispatchedQuery> + Send + 'static,
pub async fn next<M>(&self, middleware: M) -> &Selfwhere
M: FnMut(DispatchedQuery, NextQueryMiddleware) -> BoxFuture<'static, DispatchedQuery> + Send + 'static,
Register the next middleware
Sourcepub async fn handle(&self, dispatched: DispatchedQuery) -> DispatchedQuery
pub async fn handle(&self, dispatched: DispatchedQuery) -> DispatchedQuery
Handle the specified dispatched query
Sourcepub async fn handle_query<Q: Send + Sync + 'static>(
&self,
q: Q,
) -> DispatchedQuery
pub async fn handle_query<Q: Send + Sync + 'static>( &self, q: Q, ) -> DispatchedQuery
Same as handle but allows you to pass the raw type
Auto Trait Implementations§
impl Freeze for QueryHandlerManager
impl !RefUnwindSafe for QueryHandlerManager
impl Send for QueryHandlerManager
impl Sync for QueryHandlerManager
impl Unpin for QueryHandlerManager
impl !UnwindSafe for QueryHandlerManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more