Struct rjwt::Token[][src]

pub struct Token<H, A, C> { /* fields omitted */ }

The JSON Web Token wire format.

Implementations

impl<H, A, C> Token<H, A, C>[src]

pub fn new(
    iss: H,
    iat: SystemTime,
    ttl: Duration,
    actor_id: A,
    claims: C
) -> Self
[src]

Create a new (unsigned) token.

pub fn issuer(&self) -> &H[src]

The claimed issuer of this token.

pub fn actor_id(&self) -> &A[src]

The actor to whom this token claims to belong.

pub fn is_expired(&self, now: SystemTime) -> bool[src]

Returns Ok(false) if the token is expired, Err if it contains nonsensical time data (like a negative timestamp or a future issue time), or Ok(true) if the token could be valid at the given moment.

pub fn claims(&self) -> Claims<H, A, C> where
    H: Clone,
    A: Clone,
    C: Clone
[src]

The custom claims field of this token ONLY (not any of its parents, if it has them).

Trait Implementations

impl<H: Clone, A: Clone, C: Clone> Clone for Token<H, A, C>[src]

impl<H: Display, A: Display, C> Debug for Token<H, A, C>[src]

impl<'de, H, A, C> Deserialize<'de> for Token<H, A, C> where
    H: Deserialize<'de>,
    A: Deserialize<'de>,
    C: Deserialize<'de>, 
[src]

impl<H: Display, A: Display, C> Display for Token<H, A, C>[src]

impl<H: Eq, A: Eq, C: Eq> Eq for Token<H, A, C>[src]

impl<H: DeserializeOwned, A: DeserializeOwned, C: DeserializeOwned> FromStr for Token<H, A, C>[src]

type Err = Error

The associated error which can be returned from parsing.

impl<H: PartialEq, A: PartialEq, C: PartialEq> PartialEq<Token<H, A, C>> for Token<H, A, C>[src]

impl<H, A, C> Serialize for Token<H, A, C> where
    H: Serialize,
    A: Serialize,
    C: Serialize
[src]

Auto Trait Implementations

impl<H, A, C> RefUnwindSafe for Token<H, A, C> where
    A: RefUnwindSafe,
    C: RefUnwindSafe,
    H: RefUnwindSafe
[src]

impl<H, A, C> Send for Token<H, A, C> where
    A: Send,
    C: Send,
    H: Send
[src]

impl<H, A, C> Sync for Token<H, A, C> where
    A: Sync,
    C: Sync,
    H: Sync
[src]

impl<H, A, C> Unpin for Token<H, A, C> where
    A: Unpin,
    C: Unpin,
    H: Unpin
[src]

impl<H, A, C> UnwindSafe for Token<H, A, C> where
    A: UnwindSafe,
    C: UnwindSafe,
    H: UnwindSafe
[src]

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.

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.

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