pub struct Tracer {
pub calls: BTreeMap<FunctionCall, Summary>,
/* private fields */
}Expand description
Records and stores operations performed by the adapter.
This struct is intended for use inside of a TracingAdapter.
Operations must be recorded sequentially in chronological order.
Recording out-of-order operations will lead to invalid state.
Fields§
§calls: BTreeMap<FunctionCall, Summary>Implementations§
Source§impl Tracer
impl Tracer
Sourcepub fn record_time(&mut self, call_id: &FunctionCall, duration: Duration)
pub fn record_time(&mut self, call_id: &FunctionCall, duration: Duration)
Record an operation.
Sourcepub fn record_last_input_duration(&mut self, duration: Duration)
pub fn record_last_input_duration(&mut self, duration: Duration)
Set the duration of the last input.
Sourcepub fn get_last_input_duration(&self) -> Duration
pub fn get_last_input_duration(&self) -> Duration
Get the duration of the last input. Panics if the duration is None.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tracer
impl RefUnwindSafe for Tracer
impl Send for Tracer
impl Sync for Tracer
impl Unpin for Tracer
impl UnwindSafe for Tracer
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> 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