pub struct TraceRecorder { /* private fields */ }Expand description
A running trace; cheap to clone, and every clone is the same trace.
Implementations§
Source§impl TraceRecorder
impl TraceRecorder
Sourcepub fn stopped(&self) -> bool
pub fn stopped(&self) -> bool
Whether TraceRecorder::stop has run.
Sourcepub fn checkpoints(&self) -> Vec<JsonObject>
pub fn checkpoints(&self) -> Vec<JsonObject>
The checkpoints taken so far.
Sourcepub async fn checkpoint(
&self,
name: &str,
) -> Result<JsonObject, TraceRecordError>
pub async fn checkpoint( &self, name: &str, ) -> Result<JsonObject, TraceRecordError>
Capture a checkpoint taken by the automation.
§Errors
Fails after TraceRecorder::stop, or when a strict trace drops
something.
Sourcepub async fn checkpoint_with(
&self,
name: &str,
options: TraceCheckpointOptions,
) -> Result<JsonObject, TraceRecordError>
pub async fn checkpoint_with( &self, name: &str, options: TraceCheckpointOptions, ) -> Result<JsonObject, TraceRecordError>
Capture a checkpoint; {index, name, actor, reason, url, truncated, members}.
§Errors
Sourcepub async fn event(
&self,
name: &str,
data: JsonObject,
) -> Result<Option<JsonObject>, TraceRecordError>
pub async fn event( &self, name: &str, data: JsonObject, ) -> Result<Option<JsonObject>, TraceRecordError>
Record something a caller cares about on the same timeline; the record
written, or None once the trace has stopped.
§Errors
Fails when a strict trace drops the record.
Sourcepub async fn traced<T, E, F>(
&self,
action: &str,
target: Option<&str>,
work: F,
) -> Result<T, E>
pub async fn traced<T, E, F>( &self, action: &str, target: Option<&str>, work: F, ) -> Result<T, E>
Run one interaction and record it, as a traced commander method is.
target is the selector or URL acted on; typed text never belongs
there. The interaction is recorded only when the trace records the
interaction source, and the work’s own outcome is returned unchanged.
Sourcepub async fn stop(&self) -> Result<TraceResult, TraceRecordError>
pub async fn stop(&self) -> Result<TraceResult, TraceRecordError>
Stop recording and write the manifest; calling it again returns the first result.
§Errors
Fails when the manifest cannot be written or a strict trace drops something.
Sourcepub async fn stop_with(
&self,
options: TraceStopOptions,
) -> Result<TraceResult, TraceRecordError>
pub async fn stop_with( &self, options: TraceStopOptions, ) -> Result<TraceResult, TraceRecordError>
TraceRecorder::stop, discarding the bundle or recording the error
the run ended with.
§Errors
Trait Implementations§
Source§impl Clone for TraceRecorder
impl Clone for TraceRecorder
Auto Trait Implementations§
impl !RefUnwindSafe for TraceRecorder
impl !UnwindSafe for TraceRecorder
impl Freeze for TraceRecorder
impl Send for TraceRecorder
impl Sync for TraceRecorder
impl Unpin for TraceRecorder
impl UnsafeUnpin for TraceRecorder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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