Struct rjwt::Token [−][src]
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]
iss: String,
iat: SystemTime,
ttl: Duration,
actor_id: I,
claims: C
) -> Self
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]
I: Deserialize<'de>,
C: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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.
fn from_str(token: &str) -> Result<Self>
[src]
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]
I: Serialize,
C: Serialize,
Auto Trait Implementations
impl<I, C> RefUnwindSafe for Token<I, C> where
C: RefUnwindSafe,
I: RefUnwindSafe,
[src]
C: RefUnwindSafe,
I: RefUnwindSafe,
impl<I, C> Send for Token<I, C> where
C: Send,
I: Send,
[src]
C: Send,
I: Send,
impl<I, C> Sync for Token<I, C> where
C: Sync,
I: Sync,
[src]
C: Sync,
I: Sync,
impl<I, C> Unpin for Token<I, C> where
C: Unpin,
I: Unpin,
[src]
C: Unpin,
I: Unpin,
impl<I, C> UnwindSafe for Token<I, C> where
C: UnwindSafe,
I: UnwindSafe,
[src]
C: UnwindSafe,
I: 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> 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>,