Struct rjwt::SignedToken
source · pub struct SignedToken<H, A, C> { /* private fields */ }
Expand description
The data of a JWT including its (inherited) claims and encoded, signed representation.
Implementations§
source§impl<H, A, C> SignedToken<H, A, C>
impl<H, A, C> SignedToken<H, A, C>
sourcepub fn expires(&self) -> SystemTime
pub fn expires(&self) -> SystemTime
Check the expiration time of this SignedToken
.
sourcepub fn get_claim(&self, host: &H, actor: &A) -> Option<&C>
pub fn get_claim(&self, host: &H, actor: &A) -> Option<&C>
Borrow the latest (most recent) claim by the given actor
on the given host
.
sourcepub fn first_claim<Cond>(&self, cond: Cond) -> Option<(&H, &A, &C)>
pub fn first_claim<Cond>(&self, cond: Cond) -> Option<(&H, &A, &C)>
Borrow the earliest claim which matches the given cond
ition.
sourcepub fn last_claim<Cond>(&self, cond: Cond) -> Option<(&H, &A, &C)>
pub fn last_claim<Cond>(&self, cond: Cond) -> Option<(&H, &A, &C)>
Borrow the latest claim which matches the given cond
ition.
sourcepub fn into_jwt(self) -> String
pub fn into_jwt(self) -> String
Destructure this SignedToken
into its encoded representation.
Trait Implementations§
source§impl<H: Clone, A: Clone, C: Clone> Clone for SignedToken<H, A, C>
impl<H: Clone, A: Clone, C: Clone> Clone for SignedToken<H, A, C>
source§fn clone(&self) -> SignedToken<H, A, C>
fn clone(&self) -> SignedToken<H, A, C>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<H: PartialEq, A: PartialEq, C: PartialEq> PartialEq for SignedToken<H, A, C>
impl<H: PartialEq, A: PartialEq, C: PartialEq> PartialEq for SignedToken<H, A, C>
source§fn eq(&self, other: &SignedToken<H, A, C>) -> bool
fn eq(&self, other: &SignedToken<H, A, C>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<H: Eq, A: Eq, C: Eq> Eq for SignedToken<H, A, C>
impl<H, A, C> StructuralEq for SignedToken<H, A, C>
impl<H, A, C> StructuralPartialEq for SignedToken<H, A, C>
Auto Trait Implementations§
impl<H, A, C> RefUnwindSafe for SignedToken<H, A, C>
impl<H, A, C> Send for SignedToken<H, A, C>
impl<H, A, C> Sync for SignedToken<H, A, C>
impl<H, A, C> Unpin for SignedToken<H, A, C>
impl<H, A, C> UnwindSafe for SignedToken<H, A, C>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more