Skip to main content

TimeoutClock

Trait TimeoutClock 

Source
pub trait TimeoutClock {
    type Mark: Copy;

    // Required methods
    fn mark_now(&self) -> Self::Mark;
    fn elapsed_since(&self, mark: Self::Mark) -> Duration;
}
Expand description

Monotonic clock abstraction used by timeout classification.

Required Associated Types§

Source

type Mark: Copy

Opaque mark captured before execution begins.

Required Methods§

Source

fn mark_now(&self) -> Self::Mark

Captures the current mark.

Source

fn elapsed_since(&self, mark: Self::Mark) -> Duration

Returns elapsed duration since a previously captured mark.

Implementors§