pub struct Timestamp(/* private fields */);
Implementations§
source§impl Timestamp
impl Timestamp
sourcepub fn duration_since_start(&self) -> Duration
pub fn duration_since_start(&self) -> Duration
The duration since the start of the s2n-quic process.
Record the start SystemTime
at the start of the program
to derive the absolute time at which an event is emitted.
let start_time = std::time::SystemTime::now();
// `meta` is included as part of each event
let event_time = start_time + meta.timestamp.duration_since_start();
sourcepub fn saturating_duration_since(self, earlier: Timestamp) -> Duration
pub fn saturating_duration_since(self, earlier: Timestamp) -> Duration
Returns the Duration
which elapsed since an earlier Timestamp
.
If earlier
is more recent, the method returns a Duration
of 0.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Timestamp
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnwindSafe for Timestamp
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