pub struct CollectingObserver { /* private fields */ }Expand description
An observer that collects all events in order.
Stores every EngineEvent it receives in a Mutex<Vec<_>>, making
the full event history available for post-hoc assertions. This is the
primary observer used in integration tests and is also useful for
debugging production pipelines (attach it alongside a logging observer).
§Example usage
- progress_events_match_tile_count
and related tests create a
CollectingObserver, run a pyramid build, then inspect the captured events. - CLI source
wraps a
CollectingObserverfor its--verbosemode.
Implementations§
Source§impl CollectingObserver
impl CollectingObserver
Sourcepub fn events(&self) -> Vec<EngineEvent>
pub fn events(&self) -> Vec<EngineEvent>
Return a snapshot of all collected events so far, cloned from the internal mutex-protected buffer.
Sourcepub fn event_count(&self) -> usize
pub fn event_count(&self) -> usize
Return the number of events collected so far.
Trait Implementations§
Source§impl Debug for CollectingObserver
impl Debug for CollectingObserver
Source§impl Default for CollectingObserver
impl Default for CollectingObserver
Source§impl EngineObserver for CollectingObserver
impl EngineObserver for CollectingObserver
fn on_event(&self, event: EngineEvent)
Auto Trait Implementations§
impl !Freeze for CollectingObserver
impl RefUnwindSafe for CollectingObserver
impl Send for CollectingObserver
impl Sync for CollectingObserver
impl Unpin for CollectingObserver
impl UnsafeUnpin for CollectingObserver
impl UnwindSafe for CollectingObserver
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more