pub struct LogCapture<T> {
pub logs: Vec<CapturedLog>,
pub timings: TestTimings,
pub result: Option<T>,
pub panic_info: Option<String>,
}Expand description
Result of a log capture operation.
Fields§
§logs: Vec<CapturedLog>Captured log entries.
timings: TestTimingsPhase timings.
result: Option<T>Test result (if successful).
panic_info: Option<String>Panic information (if failed).
Implementations§
Source§impl<T> LogCapture<T>
impl<T> LogCapture<T>
Sourcepub fn contains_message(&self, text: &str) -> bool
pub fn contains_message(&self, text: &str) -> bool
Checks if any log contains the given message substring.
Sourcepub fn count_by_level(&self, level: LogLevel) -> usize
pub fn count_by_level(&self, level: LogLevel) -> usize
Counts logs by level.
Sourcepub fn failure_context(&self, n: usize) -> String
pub fn failure_context(&self, n: usize) -> String
Gets the last N logs for failure context.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for LogCapture<T>where
T: Freeze,
impl<T> RefUnwindSafe for LogCapture<T>where
T: RefUnwindSafe,
impl<T> Send for LogCapture<T>where
T: Send,
impl<T> Sync for LogCapture<T>where
T: Sync,
impl<T> Unpin for LogCapture<T>where
T: Unpin,
impl<T> UnwindSafe for LogCapture<T>where
T: UnwindSafe,
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: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).