Skip to main content

Clock

Trait Clock 

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

时钟抽象。返回 Unix 秒。(Debug 约束让持有闸/账本状态的结构体可以直接 derive Debug。)

Required Methods§

Source

fn now(&self) -> u64

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§