pub struct InMemoryReporter {
pub entities: Arc<Mutex<HashMap<EntityId, EntityReport>>>,
}
Expand description
A reporter that acts as a data sink and stores results for inspection in memory.
Primarily used for testing.
Fields§
§entities: Arc<Mutex<HashMap<EntityId, EntityReport>>>
Implementations§
Source§impl InMemoryReporter
impl InMemoryReporter
pub fn new() -> Self
pub fn get_reports(&self) -> Vec<InMemoryReport>
Trait Implementations§
Source§impl Clone for InMemoryReporter
impl Clone for InMemoryReporter
Source§fn clone(&self) -> InMemoryReporter
fn clone(&self) -> InMemoryReporter
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Reporter for InMemoryReporter
impl Reporter for InMemoryReporter
Source§fn new_entity(&self, id: &EntityId, name: &str) -> Result<(), Error>
fn new_entity(&self, id: &EntityId, name: &str) -> Result<(), Error>
Record a new test suite or test case. This should be called once per entity.
Source§fn set_entity_info(&self, _entity: &EntityId, _info: &EntityInfo)
fn set_entity_info(&self, _entity: &EntityId, _info: &EntityInfo)
Add additional info for an entity.
Source§fn entity_started(
&self,
id: &EntityId,
timestamp: Timestamp,
) -> Result<(), Error>
fn entity_started( &self, id: &EntityId, timestamp: Timestamp, ) -> Result<(), Error>
Record that a test run, suite or case has started.
Source§fn entity_stopped(
&self,
id: &EntityId,
outcome: &ReportedOutcome,
timestamp: Timestamp,
) -> Result<(), Error>
fn entity_stopped( &self, id: &EntityId, outcome: &ReportedOutcome, timestamp: Timestamp, ) -> Result<(), Error>
Record that a test run, suite, or case has stopped.
Source§fn entity_finished(&self, id: &EntityId) -> Result<(), Error>
fn entity_finished(&self, id: &EntityId) -> Result<(), Error>
Record that a test run, suite, or case has stopped. After this method is called for
an entity, no additional events or artifacts may be added to the entity.
Implementations of
Reporter
may assume that entity_finished
will be called no more
than once for any entity.Source§fn new_artifact(
&self,
id: &EntityId,
artifact_type: &ArtifactType,
) -> Result<Box<dyn Write + Send + Sync + 'static>, Error>
fn new_artifact( &self, id: &EntityId, artifact_type: &ArtifactType, ) -> Result<Box<dyn Write + Send + Sync + 'static>, Error>
Create a new artifact scoped to the referenced entity.
Source§fn new_directory_artifact(
&self,
id: &EntityId,
artifact_type: &DirectoryArtifactType,
moniker: Option<String>,
) -> Result<Box<dyn DirectoryWrite + Send + Sync + 'static>, Error>
fn new_directory_artifact( &self, id: &EntityId, artifact_type: &DirectoryArtifactType, moniker: Option<String>, ) -> Result<Box<dyn DirectoryWrite + Send + Sync + 'static>, Error>
Create a new artifact consisting of multiple files.
Auto Trait Implementations§
impl Freeze for InMemoryReporter
impl !RefUnwindSafe for InMemoryReporter
impl Send for InMemoryReporter
impl Sync for InMemoryReporter
impl Unpin for InMemoryReporter
impl !UnwindSafe for InMemoryReporter
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
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