Skip to main content

WxClock

Trait WxClock 

Source
pub trait WxClock:
    Send
    + Sync
    + Debug {
    // Required method
    fn now_ms(&self) -> i64;
}
Expand description

时钟抽象(可注入)。

Debug 为超 trait:携带 clock 的配置结构(如 WxDefaultConfig) 可继续 derive Debug

Required Methods§

Source

fn now_ms(&self) -> i64

当前时间(UNIX 纪元毫秒)。

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§