Trait openraft::instant::Instant

source ·
pub trait Instant: Add<Duration, Output = Self> + AddAssign<Duration> + Clone + Copy + Debug + Eq + Ord + PartialEq + PartialOrd + RefUnwindSafe + OptionalSend + Sub<Duration, Output = Self> + Sub<Self, Output = Duration> + SubAssign<Duration> + OptionalSync + Unpin + UnwindSafe + 'static {
    // Required method
    fn now() -> Self;

    // Provided method
    fn elapsed(&self) -> Duration { ... }
}
Expand description

A measurement of a monotonically non-decreasing clock.

Required Methods§

source

fn now() -> Self

Return the current instant.

Provided Methods§

source

fn elapsed(&self) -> Duration

Return the amount of time since the instant.

The returned duration is guaranteed to be non-negative.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Instant for Instant

source§

fn now() -> Self

Implementors§