Skip to main content

TimeProvider

Trait TimeProvider 

pub trait TimeProvider:
    Debug
    + Send
    + Sync {
    // Required method
    fn current_time(&self) -> Option<UnixTime>;
}
Available on crate feature rustls only.
Expand description

An object that provides the current time.

This is used to, for example, check if a certificate has expired during certificate validation, or to check the age of a ticket.

Required Methods§

fn current_time(&self) -> Option<UnixTime>

Returns the current wall time.

This is not required to be monotonic.

Return None if unable to retrieve the time.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

§

impl TimeProvider for DefaultTimeProvider

Available on crate feature std only.