Trait TokenExpiry
pub trait TokenExpiry<'a>:
Clone
+ Serialize
+ Deserialize<'a> {
const EXPIRY_LEEWAY_SECONDS: u64 = 60;
const REFRESH_LEEWAY_SECONDS: u64 = 180;
const MIN_REFRESH_INTERVAL_SECONDS: u64 = 10;
// Required method
fn expires_at_secs(&self) -> u64;
// Provided methods
fn is_expired(&self) -> bool { ... }
fn should_refresh(&self) -> bool { ... }
fn refresh_interval(&self) -> Duration { ... }
fn min_refresh_interval() -> Duration { ... }
}Provided Associated Constants§
const EXPIRY_LEEWAY_SECONDS: u64 = 60
const REFRESH_LEEWAY_SECONDS: u64 = 180
const MIN_REFRESH_INTERVAL_SECONDS: u64 = 10
Required Methods§
fn expires_at_secs(&self) -> u64
Provided Methods§
fn is_expired(&self) -> bool
fn should_refresh(&self) -> bool
fn refresh_interval(&self) -> Duration
fn min_refresh_interval() -> Duration
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.