pub struct Reporter { /* private fields */ }Expand description
Fans run events out to every enabled sink.
Implementations§
Source§impl Reporter
impl Reporter
Sourcepub fn new(
level: Level,
color: ColorMode,
log_file: Option<&Path>,
junit_file: Option<&Path>,
trace_file: Option<&Path>,
github_annotations: bool,
) -> Result<Self>
pub fn new( level: Level, color: ColorMode, log_file: Option<&Path>, junit_file: Option<&Path>, trace_file: Option<&Path>, github_annotations: bool, ) -> Result<Self>
Creates a reporter with the given console settings and optional output files. Fails if a log/JUnit/trace file cannot be opened.
§Errors
Returns an io error when any configured output file cannot be created.
Sourcepub fn emit(&self, event: &TestEvent) -> Result<()>
pub fn emit(&self, event: &TestEvent) -> Result<()>
Emits one event to every enabled sink.
§Errors
Returns an io error when writing the NDJSON log file fails.
Sourcepub fn info(&self, msg: impl AsRef<str>)
pub fn info(&self, msg: impl AsRef<str>)
Writes a plain informational line if the current level allows it.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Reporter
impl RefUnwindSafe for Reporter
impl Send for Reporter
impl Sync for Reporter
impl Unpin for Reporter
impl UnsafeUnpin for Reporter
impl UnwindSafe for Reporter
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