pub struct CommandHandlerManager { /* private fields */ }Expand description
Manages the middlewares for the current command handler
Implementations§
Source§impl CommandHandlerManager
impl CommandHandlerManager
Sourcepub async fn new(handler: impl CommandHandler + 'static) -> Self
pub async fn new(handler: impl CommandHandler + 'static) -> Self
Create a new instance
pub async fn next<M>(&self, middleware: M) -> &Selfwhere
M: FnMut(DispatchedCommand, NextCommandMiddleware) -> BoxFuture<'static, DispatchedCommand> + Send + 'static,
pub async fn handle(&self, dispatched: DispatchedCommand) -> DispatchedCommand
pub async fn handle_command<C: Send + Sync + 'static>( &self, command: C, ) -> DispatchedCommand
Auto Trait Implementations§
impl Freeze for CommandHandlerManager
impl !RefUnwindSafe for CommandHandlerManager
impl Send for CommandHandlerManager
impl Sync for CommandHandlerManager
impl Unpin for CommandHandlerManager
impl !UnwindSafe for CommandHandlerManager
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