Trait TokenExpiry
pub trait TokenExpiry<'a>:
Clone
+ Serialize
+ Deserialize<'a> {
const EXPIRY_LEEWAY_SECONDS: u64 = 60u64;
const REFRESH_LEEWAY_SECONDS: u64 = 180u64;
const MIN_REFRESH_INTERVAL_SECONDS: u64 = 10u64;
// 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 = 60u64
const REFRESH_LEEWAY_SECONDS: u64 = 180u64
const MIN_REFRESH_INTERVAL_SECONDS: u64 = 10u64
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
Object Safety§
This trait is not object safe.