pub struct DispatchResult { /* private fields */ }Expand description
Result of event dispatch.
Contains information about the success or failure of event dispatch, including any errors that occurred during listener execution.
Implementations§
Source§impl DispatchResult
impl DispatchResult
Sourcepub fn is_blocked(&self) -> bool
pub fn is_blocked(&self) -> bool
Check if the event was blocked by middleware.
Sourcepub fn listener_count(&self) -> usize
pub fn listener_count(&self) -> usize
Get the total number of listeners that were called.
Sourcepub fn success_count(&self) -> usize
pub fn success_count(&self) -> usize
Get the number of successful handlers.
Sourcepub fn error_count(&self) -> usize
pub fn error_count(&self) -> usize
Get the number of failed handlers.
Sourcepub fn errors(&self) -> Vec<&ListenerError>
pub fn errors(&self) -> Vec<&ListenerError>
Borrow every error produced by failing listeners, in dispatch order.
Sourcepub fn all_succeeded(&self) -> bool
pub fn all_succeeded(&self) -> bool
Check if all handlers succeeded.
Returns false if any listener errored or if the event was
blocked by middleware.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Check if any handlers failed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DispatchResult
impl !RefUnwindSafe for DispatchResult
impl Send for DispatchResult
impl Sync for DispatchResult
impl Unpin for DispatchResult
impl UnsafeUnpin for DispatchResult
impl !UnwindSafe for DispatchResult
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