Trait TimeProvider

Source
pub trait TimeProvider {
    // Required methods
    fn now() -> Self;
    fn elapsed(&self) -> Duration;
    fn write(&self, f: &mut Formatter<'_>) -> Result;
}

Required Methods§

Source

fn now() -> Self

Source

fn elapsed(&self) -> Duration

Source

fn write(&self, f: &mut Formatter<'_>) -> Result

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TimeProvider for ()

Source§

fn now() -> Self

Source§

fn elapsed(&self) -> Duration

Source§

fn write(&self, _f: &mut Formatter<'_>) -> Result

Source§

impl TimeProvider for Instant

Source§

fn now() -> Self

Source§

fn elapsed(&self) -> Duration

Source§

fn write(&self, f: &mut Formatter<'_>) -> Result

Implementors§