Skip to main content

Clock

Trait Clock 

Source
pub trait Clock {
    // Required method
    fn now(&self) -> Option<Timestamp>;
}
Expand description

A service to get the current Timestamp.

Required Methods§

Source

fn now(&self) -> Option<Timestamp>

Read the current Timestamp.

This method may return None if the clock couldn’t be read for any reason. That may be because the clock doesn’t actually supporting reading now, time moving backwards, or any other reason that could result in an inaccurate reading.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<'a, T: Clock + ?Sized + 'a> Clock for Arc<T>

Available on crate feature alloc only.
Source§

impl<'a, T: Clock + ?Sized + 'a> Clock for Box<T>

Available on crate feature alloc only.
Source§

impl<'a, T: Clock + ?Sized> Clock for &'a T

Source§

impl<'a, T: Clock> Clock for Option<T>

Implementors§

Source§

impl Clock for Empty

Source§

impl<'a> Clock for dyn ErasedClock + 'a

Source§

impl<'a> Clock for dyn ErasedClock + Send + Sync + 'a

Source§

impl<T: Clock> Clock for AssertInternal<T>