Struct rjwt::Token [−][src]
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]
iss: H,
iat: SystemTime,
ttl: Duration,
actor_id: A,
claims: C
) -> Self
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]
H: Clone,
A: Clone,
C: Clone,
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]
H: Deserialize<'de>,
A: Deserialize<'de>,
C: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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.
fn from_str(token: &str) -> Result<Self>
[src]
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]
H: Serialize,
A: Serialize,
C: Serialize,
Auto Trait Implementations
impl<H, A, C> RefUnwindSafe for Token<H, A, C> where
A: RefUnwindSafe,
C: RefUnwindSafe,
H: RefUnwindSafe,
[src]
A: RefUnwindSafe,
C: RefUnwindSafe,
H: RefUnwindSafe,
impl<H, A, C> Send for Token<H, A, C> where
A: Send,
C: Send,
H: Send,
[src]
A: Send,
C: Send,
H: Send,
impl<H, A, C> Sync for Token<H, A, C> where
A: Sync,
C: Sync,
H: Sync,
[src]
A: Sync,
C: Sync,
H: Sync,
impl<H, A, C> Unpin for Token<H, A, C> where
A: Unpin,
C: Unpin,
H: Unpin,
[src]
A: Unpin,
C: Unpin,
H: Unpin,
impl<H, A, C> UnwindSafe for Token<H, A, C> where
A: UnwindSafe,
C: UnwindSafe,
H: UnwindSafe,
[src]
A: UnwindSafe,
C: UnwindSafe,
H: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,