pub struct MonotonicTs(/* private fields */);Expand description
Monotonic timestamp — nanoseconds since feed start.
Used for all internal ordering, duration calculations, and temporal logic. Never derived from wall-clock time. Compare freely for ordering.
Implementations§
Source§impl MonotonicTs
impl MonotonicTs
Sourcepub fn from_nanos(nanos: u64) -> Self
pub fn from_nanos(nanos: u64) -> Self
Create a monotonic timestamp from nanoseconds since feed start.
Sourcepub fn as_secs_f64(self) -> f64
pub fn as_secs_f64(self) -> f64
Returns the timestamp as fractional seconds.
Sourcepub fn checked_duration_since(self, other: Self) -> Option<Duration>
pub fn checked_duration_since(self, other: Self) -> Option<Duration>
Compute the duration between two timestamps.
Returns None if other is later than self.
Sourcepub fn saturating_duration_since(self, other: Self) -> Duration
pub fn saturating_duration_since(self, other: Self) -> Duration
Saturating subtraction — returns zero duration if other > self.
Trait Implementations§
Source§impl Add<Duration> for MonotonicTs
impl Add<Duration> for MonotonicTs
Source§impl Clone for MonotonicTs
impl Clone for MonotonicTs
Source§fn clone(&self) -> MonotonicTs
fn clone(&self) -> MonotonicTs
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MonotonicTs
impl Debug for MonotonicTs
Source§impl Display for MonotonicTs
impl Display for MonotonicTs
Source§impl Hash for MonotonicTs
impl Hash for MonotonicTs
Source§impl Ord for MonotonicTs
impl Ord for MonotonicTs
Source§fn cmp(&self, other: &MonotonicTs) -> Ordering
fn cmp(&self, other: &MonotonicTs) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for MonotonicTs
impl PartialEq for MonotonicTs
Source§impl PartialOrd for MonotonicTs
impl PartialOrd for MonotonicTs
impl Copy for MonotonicTs
impl Eq for MonotonicTs
impl StructuralPartialEq for MonotonicTs
Auto Trait Implementations§
impl Freeze for MonotonicTs
impl RefUnwindSafe for MonotonicTs
impl Send for MonotonicTs
impl Sync for MonotonicTs
impl Unpin for MonotonicTs
impl UnsafeUnpin for MonotonicTs
impl UnwindSafe for MonotonicTs
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