Skip to main content

TimeSource

Trait TimeSource 

Source
pub trait TimeSource:
    Debug
    + Send
    + Sync {
    // Required method
    fn now(&self) -> SystemTime;
}
Expand description

Trait with a now() function returning the current time

Required Methods§

Source

fn now(&self) -> SystemTime

Returns the current time

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl TimeSource for SystemTime

Available on crate feature test-util only.
Source§

fn now(&self) -> SystemTime

Implementors§

Source§

impl TimeSource for ManualTimeSource

Available on crate feature test-util only.
Source§

impl TimeSource for SharedTimeSource

Source§

impl TimeSource for StaticTimeSource

Source§

impl TimeSource for SystemTimeSource

Source§

impl TimeSource for TickAdvanceTime

Available on crate feature test-util only.