Trait ProvideTime

Source
pub trait ProvideTime<Runtime>
where Runtime: Async,
{ type Time: Async; // Required methods fn now(runtime: &Runtime) -> Self::Time; fn duration_since( current_time: &Self::Time, other_time: &Self::Time, ) -> Duration; }

Required Associated Types§

Required Methods§

Source

fn now(runtime: &Runtime) -> 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<Component, Runtime> ProvideTime<Runtime> for Component
where Runtime: Async, Component: DelegateComponent<TimeComponent>, Component::Delegate: ProvideTime<Runtime>,

Source§

type Time = <<Component as DelegateComponent<TimeComponent>>::Delegate as ProvideTime<Runtime>>::Time