Struct aliri_tokens::BorrowedToken[][src]

pub struct BorrowedToken<'a> { /* fields omitted */ }
Expand description

An outstanding borrow of a token

This borrow should be held for as brief a time as possible, as outstanding token borrows will block updates of a new token.

Methods from Deref<Target = TokenWithLifetime>

pub fn access_token(&self) -> &AccessTokenRef[src]

Gets the current access token

pub fn id_token(&self) -> Option<&IdTokenRef>[src]

Gets the current ID token, if available

pub fn lifetime(&self) -> DurationSecs[src]

Gets the token’s lifetime

pub fn issued(&self) -> UnixTime[src]

Gets the time that the token was issued

pub fn stale(&self) -> UnixTime[src]

Gets the time that the token will become stale

pub fn expiry(&self) -> UnixTime[src]

Gets the time that the token will expire

pub fn fresh_interval(&self) -> Range<UnixTime>[src]

Gets the interval during which the token should be considered fresh

pub fn valid_interval(&self) -> Range<UnixTime>[src]

Gets the interval during which the token is valid

pub fn token_status(&self) -> TokenStatus[src]

Gets the token’s current lifetime status

pub fn token_status_with_clock<C: Clock>(&self, clock: &C) -> TokenStatus[src]

Gets the token’s lifetime status based on the current time as reported by the provided clock

pub fn token_status_at(&self, time: UnixTime) -> TokenStatus[src]

Gets the token’s lifetime status as of the provided time

pub fn until_stale(&self) -> DurationSecs[src]

Gets a duration for how much longer the token will be fresh

pub fn until_stale_with_clock<C: Clock>(&self, clock: &C) -> DurationSecs[src]

Gets a duration for how much longer the token will be fresh based on the current time as reported by the provided clock

pub fn until_stale_at(&self, time: UnixTime) -> DurationSecs[src]

Gets a duration for how much longer the token would be fresh as of the provided time

pub fn until_expired(&self) -> DurationSecs[src]

Gets a duration for how much longer the token will be valid

pub fn until_expired_with_clock<C: Clock>(&self, clock: &C) -> DurationSecs[src]

Gets a duration for how much longer the token will be valid based on the current time as reported by the provided clock

pub fn until_expired_at(&self, time: UnixTime) -> DurationSecs[src]

Gets a duration for how much longer the token would be valid as of the provided time

Trait Implementations

impl<'a> Debug for BorrowedToken<'a>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<'a> Deref for BorrowedToken<'a>[src]

type Target = TokenWithLifetime

The resulting type after dereferencing.

fn deref(&self) -> &Self::Target[src]

Dereferences the value.

Auto Trait Implementations

impl<'a> RefUnwindSafe for BorrowedToken<'a>

impl<'a> !Send for BorrowedToken<'a>

impl<'a> Sync for BorrowedToken<'a>

impl<'a> Unpin for BorrowedToken<'a>

impl<'a> UnwindSafe for BorrowedToken<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V