pub trait TimeProvider:
Debug
+ Send
+ Sync {
// Required method
fn current_time(&self) -> Option<UnixTime>;
}展开描述
提供当前时间的对象
This is 用 到, 用于 example, 检查 if 一个 certificate has expired during certificate validation, 或 到 检查 the age of 一个 票据
必需方法§
Sourcefn current_time(&self) -> Option<UnixTime>
fn current_time(&self) -> Option<UnixTime>
返回当前的挂钟时间。
This is not required 到 be monotonic.
Return None if unable 到 retrieve the time.
实现者§
impl TimeProvider for DefaultTimeProvider
Available on crate feature
std only.