Struct aliri_tokens::TokenWithLifetime
source · pub struct TokenWithLifetime { /* private fields */ }
Expand description
A token as returned by the authority with some additional lifetime information
Implementations§
source§impl TokenWithLifetime
impl TokenWithLifetime
sourcepub fn access_token(&self) -> &AccessTokenRef
pub fn access_token(&self) -> &AccessTokenRef
Gets the current access token
sourcepub fn id_token(&self) -> Option<&IdTokenRef>
pub fn id_token(&self) -> Option<&IdTokenRef>
Gets the current ID token, if available
sourcepub fn lifetime(&self) -> DurationSecs
pub fn lifetime(&self) -> DurationSecs
Gets the token’s lifetime
sourcepub fn fresh_interval(&self) -> Range<UnixTime>
pub fn fresh_interval(&self) -> Range<UnixTime>
Gets the interval during which the token should be considered fresh
sourcepub fn valid_interval(&self) -> Range<UnixTime>
pub fn valid_interval(&self) -> Range<UnixTime>
Gets the interval during which the token is valid
sourcepub fn token_status(&self) -> TokenStatus
pub fn token_status(&self) -> TokenStatus
Gets the token’s current lifetime status
sourcepub fn token_status_with_clock<C: Clock>(&self, clock: &C) -> TokenStatus
pub fn token_status_with_clock<C: Clock>(&self, clock: &C) -> TokenStatus
Gets the token’s lifetime status based on the current time as reported by the provided clock
sourcepub fn token_status_at(&self, time: UnixTime) -> TokenStatus
pub fn token_status_at(&self, time: UnixTime) -> TokenStatus
Gets the token’s lifetime status as of the provided time
sourcepub fn until_stale(&self) -> DurationSecs
pub fn until_stale(&self) -> DurationSecs
Gets a duration for how much longer the token will be fresh
sourcepub fn until_stale_with_clock<C: Clock>(&self, clock: &C) -> DurationSecs
pub fn until_stale_with_clock<C: Clock>(&self, clock: &C) -> DurationSecs
Gets a duration for how much longer the token will be fresh based on the current time as reported by the provided clock
sourcepub fn until_stale_at(&self, time: UnixTime) -> DurationSecs
pub fn until_stale_at(&self, time: UnixTime) -> DurationSecs
Gets a duration for how much longer the token would be fresh as of the provided time
sourcepub fn until_expired(&self) -> DurationSecs
pub fn until_expired(&self) -> DurationSecs
Gets a duration for how much longer the token will be valid
sourcepub fn until_expired_with_clock<C: Clock>(&self, clock: &C) -> DurationSecs
pub fn until_expired_with_clock<C: Clock>(&self, clock: &C) -> DurationSecs
Gets a duration for how much longer the token will be valid based on the current time as reported by the provided clock
sourcepub fn until_expired_at(&self, time: UnixTime) -> DurationSecs
pub fn until_expired_at(&self, time: UnixTime) -> DurationSecs
Gets a duration for how much longer the token would be valid as of the provided time