Skip to main content

Clock

Trait Clock 

Source
pub trait Clock: Debug {
    // Required method
    fn now(&self) -> PrimitiveDateTime;
}
Expand description

An object that can measure and return the current time

Required Methods§

Source

fn now(&self) -> PrimitiveDateTime

Returns the current date and time in your local timezone (https://learn.microsoft.com/en-us/windows/win32/sysinfo/file-times)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§