Skip to main content

Expirable

Trait Expirable 

Source
pub trait Expirable {
    // Required method
    fn expires_at_ms_opt(&self) -> Option<u64>;

    // Provided method
    fn expires_at_ms(&self) -> u64 { ... }
}
Expand description

A trait for evaluating and returning the absolute expiration time.

Required Methods§

Source

fn expires_at_ms_opt(&self) -> Option<u64>

Returns the optional expiration time in milliseconds since the Unix epoch (January 1, 1970).

Provided Methods§

Source

fn expires_at_ms(&self) -> u64

Evaluates and returns the absolute expiration time in milliseconds since the Unix epoch (January 1, 1970).

If there is no expiration time, it returns u64::MAX.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T> Expirable for Option<T>
where T: Expirable,

Source§

impl<T> Expirable for &T
where T: Expirable,

Implementors§