Trait HasTime

Source
pub trait HasTime: Async {
    type Time: Async;

    // Required methods
    fn now(&self) -> Self::Time;
    fn duration_since(
        current_time: &Self::Time,
        other_time: &Self::Time,
    ) -> Duration;
}

Required Associated Types§

Required Methods§

Source

fn now(&self) -> Self::Time

Source

fn duration_since( current_time: &Self::Time, other_time: &Self::Time, ) -> Duration

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.

Implementors§

Source§

impl<Runtime> HasTime for Runtime
where Runtime: Async + HasComponents, Runtime::Components: ProvideTime<Runtime>,

Source§

type Time = <<Runtime as HasComponents>::Components as ProvideTime<Runtime>>::Time