pub struct TraceRecorder<'a> { /* private fields */ }Expand description
Records trace events for a single test.
Implementations§
Source§impl<'a> TraceRecorder<'a>
impl<'a> TraceRecorder<'a>
Sourcepub fn for_steps(steps: &[TestStep]) -> Self
pub fn for_steps(steps: &[TestStep]) -> Self
Create a new recorder pre-sized for the given step count.
Sourcepub fn record_step(
&mut self,
step: &'a TestStep,
parent_id: Option<Cow<'a, str>>,
)
pub fn record_step( &mut self, step: &'a TestStep, parent_id: Option<Cow<'a, str>>, )
Record a test step as before/after events (borrows step data, no cloning).
Sourcepub fn record_steps(&mut self, steps: &'a [TestStep])
pub fn record_steps(&mut self, steps: &'a [TestStep])
Record all steps from a test’s outcome.
Sourcepub fn into_zip_bytes(self) -> Result<Vec<u8>, String>
pub fn into_zip_bytes(self) -> Result<Vec<u8>, String>
Serialize all events into an in-memory JSONL+ZIP buffer.
Uses Stored compression (no deflate CPU) and serde_json::to_writer
streaming directly into the ZIP — no intermediate String per event.
Returns owned bytes suitable for spawn_blocking file write.
§Errors
Returns an error if serialization fails (should never happen).
Auto Trait Implementations§
impl<'a> Freeze for TraceRecorder<'a>
impl<'a> RefUnwindSafe for TraceRecorder<'a>
impl<'a> Send for TraceRecorder<'a>
impl<'a> Sync for TraceRecorder<'a>
impl<'a> Unpin for TraceRecorder<'a>
impl<'a> UnsafeUnpin for TraceRecorder<'a>
impl<'a> UnwindSafe for TraceRecorder<'a>
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 more