Skip to main content

Time

Trait Time 

Source
pub trait Time: Copy {
    const FIXED: bool = false;

    // Required method
    fn limit(self, timeout: Option<Duration>) -> Option<Duration>;

    // Provided methods
    fn sample_at(self, wall: Instant) -> Sample { ... }
    fn start(self) -> Sample { ... }
    fn tick(self) -> Result<Sample, Error> { ... }
    fn quiesce(self) -> Result<Sample, Error> { ... }
    fn timeout(self, deadline: Deadline<'_>) -> Duration { ... }
}

Provided Associated Constants§

Source

const FIXED: bool = false

Required Methods§

Source

fn limit(self, timeout: Option<Duration>) -> Option<Duration>

Provided Methods§

Source

fn sample_at(self, wall: Instant) -> Sample

Source

fn start(self) -> Sample

Source

fn tick(self) -> Result<Sample, Error>

Source

fn quiesce(self) -> Result<Sample, Error>

Source

fn timeout(self, deadline: Deadline<'_>) -> Duration

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Time for Deadline<'_>

Source§

const FIXED: bool = true

Source§

impl Time for Wall

Source§

impl<L: Limit, S: Time> Time for Bound<L, S>

Source§

const FIXED: bool = S::FIXED