Struct rjwt::Token[][src]

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

A Javascript Web Token.

Implementations

impl<I, C> Token<I, C>[src]

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

Create a new (unsigned) token.

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

The claimed issuer of this token.

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

The actor to whom this token claims to belong.

pub fn expired(&self, now: SystemTime) -> Result<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) -> &C[src]

The custom claims field of this token.

Trait Implementations

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

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

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

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

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

type Err = Error

The associated error which can be returned from parsing.

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

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

Auto Trait Implementations

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

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

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

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

impl<I, C> UnwindSafe for Token<I, C> where
    C: UnwindSafe,
    I: 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> 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>,