pub struct CommandEvents<T: ICommandInfo> { /* private fields */ }Expand description
Collect and query command lifecycle events.
Implementations§
Source§impl<T: ICommandInfo + 'static> CommandEvents<T>
impl<T: ICommandInfo + 'static> CommandEvents<T>
Sourcepub fn new(mediator: Arc<CommandMediator<T>>) -> Self
pub fn new(mediator: Arc<CommandMediator<T>>) -> Self
Create a new CommandEvents backed by a CommandMediator.
Sourcepub async fn start(&self)
pub async fn start(&self)
Start listening for events from the CommandMediator.
Sourcepub async fn get(&self) -> MutexGuard<'_, Vec<T::Event>>
pub async fn get(&self) -> MutexGuard<'_, Vec<T::Event>>
Lock and return the collected events.
Sourcepub async fn count(&self) -> CommandEventCounts
pub async fn count(&self) -> CommandEventCounts
Count events by EventKind.
Trait Implementations§
Source§impl<T: ICommandInfo + 'static> FromServices for CommandEvents<T>
impl<T: ICommandInfo + 'static> FromServices for CommandEvents<T>
Source§type Error = ResolveError
type Error = ResolveError
Error type returned by
FromServices::from_services.Source§fn from_services(
services: &ServiceProvider,
) -> Result<Self, Report<Self::Error>>
fn from_services( services: &ServiceProvider, ) -> Result<Self, Report<Self::Error>>
Create an instance by resolving dependencies from the
ServiceProvider.Auto Trait Implementations§
impl<T> !Freeze for CommandEvents<T>
impl<T> !RefUnwindSafe for CommandEvents<T>
impl<T> Send for CommandEvents<T>
impl<T> Sync for CommandEvents<T>
impl<T> Unpin for CommandEvents<T>
impl<T> UnsafeUnpin for CommandEvents<T>
impl<T> !UnwindSafe for CommandEvents<T>
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