pub struct TestMonitor { /* private fields */ }Expand description
A monitor that collects information for later inspection, particularly from tests.
Errors are collected in a vector.
Tasks are ignored.
Totals of counters are kept.
Implementations§
Source§impl TestMonitor
impl TestMonitor
pub fn new() -> Self
Sourcepub fn arc() -> Arc<TestMonitor>
pub fn arc() -> Arc<TestMonitor>
Construct a new TestMonitor and wrap it in an Arc.
pub fn get_counter(&self, counter: Counter) -> usize
Sourcepub fn take_errors(&self) -> Vec<Error>
pub fn take_errors(&self) -> Vec<Error>
Return the list of errors, and clear it.
Sourcepub fn assert_no_errors(&self)
pub fn assert_no_errors(&self)
Assert that no errors have yet occurred (since the list was cleared.)
Panic if any errors have been reported.
Sourcepub fn assert_counter(&self, counter: Counter, expected: usize)
pub fn assert_counter(&self, counter: Counter, expected: usize)
Assert the expected value of a counter.
pub fn take_started_files(&self) -> Vec<Apath>
pub fn counters(&self) -> &Counters
Trait Implementations§
Source§impl Default for TestMonitor
impl Default for TestMonitor
Source§fn default() -> TestMonitor
fn default() -> TestMonitor
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for TestMonitor
impl RefUnwindSafe for TestMonitor
impl Send for TestMonitor
impl Sync for TestMonitor
impl Unpin for TestMonitor
impl UnwindSafe for TestMonitor
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreCreates a shared type from an unshared type.