pub struct Trace {
pub events: Vec<PollEvent>,
pub start: Instant,
}Expand description
Collected trace from a TracedFuture.
A Trace holds the recorded events plus a reference Instant used
to compute event offsets. The reference instant is not serialized;
when a Trace is deserialized the start field is reset to the
deserialization time and only the per-event offset values are
authoritative.
§Examples
use async_reify::Trace;
let trace = Trace::new();
assert!(trace.events.is_empty());Fields§
§events: Vec<PollEvent>All poll events in order.
start: InstantReference instant against which each event’s offset was measured.
Not serialized: only the offsets persist across (de)serialization.
Implementations§
Source§impl Trace
impl Trace
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct an empty trace anchored at the current instant.
§Examples
use async_reify::Trace;
let t = Trace::new();
assert!(t.events.is_empty());Return a fresh shared, mutex-protected trace suitable for use
with LabeledFuture.
§Examples
use async_reify::Trace;
let shared = Trace::shared();
assert!(shared.lock().unwrap().events.is_empty());Trait Implementations§
Auto Trait Implementations§
impl Freeze for Trace
impl RefUnwindSafe for Trace
impl Send for Trace
impl Sync for Trace
impl Unpin for Trace
impl UnsafeUnpin for Trace
impl UnwindSafe for Trace
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