pub struct Busstop { /* private fields */ }Implementations§
Source§impl Busstop
impl Busstop
Sourcepub fn instance() -> Arc<Self>
pub fn instance() -> Arc<Self>
Returns the current instance of the bus A new instance will be created if one does not exist You can call this method as many times as you like
pub async fn register_command_middleware<C, M>(&self, middleware: M) -> &Selfwhere
M: FnMut(DispatchedCommand, NextCommandMiddleware) -> BoxFuture<'static, DispatchedCommand> + Send + Sync + 'static,
pub async fn register_query_middleware<T, M>(&self, middleware: M) -> &Selfwhere
M: FnMut(DispatchedQuery, NextQueryMiddleware) -> BoxFuture<'static, DispatchedQuery> + Send + Sync + 'static,
Sourcepub async fn register_command<C>(
&self,
handler: impl CommandHandler + 'static,
) -> &Self
pub async fn register_command<C>( &self, handler: impl CommandHandler + 'static, ) -> &Self
Register an handler for a command
Sourcepub async fn command_has_handler<C>(&self) -> bool
pub async fn command_has_handler<C>(&self) -> bool
Checks if a command has a register handler
Sourcepub async fn register_query<T>(
&self,
handler: impl QueryHandler + 'static,
) -> &Self
pub async fn register_query<T>( &self, handler: impl QueryHandler + 'static, ) -> &Self
Register an handler for a command
Sourcepub async fn query_has_handler<Q>(&self) -> bool
pub async fn query_has_handler<Q>(&self) -> bool
Checks if a query has a registered handler
Sourcepub async fn dispatch_command<T: Send + Sync + 'static>(
&self,
command: T,
) -> bool
pub async fn dispatch_command<T: Send + Sync + 'static>( &self, command: T, ) -> bool
Dispatches a command event
Sourcepub async fn dispatch_query<Q: Send + Sync + 'static>(
&self,
query: Q,
) -> DispatchedQuery
pub async fn dispatch_query<Q: Send + Sync + 'static>( &self, query: Q, ) -> DispatchedQuery
Dispatches a query event
Auto Trait Implementations§
impl !Freeze for Busstop
impl !RefUnwindSafe for Busstop
impl Send for Busstop
impl Sync for Busstop
impl Unpin for Busstop
impl !UnwindSafe for Busstop
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