Struct s2n_quic_core::event::Timestamp
source · [−]pub struct Timestamp(_);Implementations
sourceimpl 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: Self) -> Duration
pub fn saturating_duration_since(self, earlier: Self) -> 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 RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnwindSafe for Timestamp
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more