pub struct Token<H, A, C> { /* private fields */ }
Expand description
The JSON Web Token wire format
Implementations§
source§impl<H, A, C> Token<H, A, C>
impl<H, A, C> Token<H, A, C>
sourcepub fn new(
iss: H,
iat: SystemTime,
ttl: Duration,
actor_id: A,
claims: C
) -> Self
pub fn new( iss: H, iat: SystemTime, ttl: Duration, actor_id: A, claims: C ) -> Self
Create a new (unsigned) token.
sourcepub fn is_expired(&self, now: SystemTime) -> bool
pub fn is_expired(&self, now: SystemTime) -> bool
Return true
if this token is expired (or not yet issued) at the given moment.
Trait Implementations§
source§impl<'de, H, A, C> Deserialize<'de> for Token<H, A, C>
impl<'de, H, A, C> Deserialize<'de> for Token<H, A, C>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<H: PartialEq, A: PartialEq, C: PartialEq> PartialEq for Token<H, A, C>
impl<H: PartialEq, A: PartialEq, C: PartialEq> PartialEq for Token<H, A, C>
impl<H: Eq, A: Eq, C: Eq> Eq for Token<H, A, C>
impl<H, A, C> StructuralEq for Token<H, A, C>
impl<H, A, C> StructuralPartialEq for Token<H, A, C>
Auto Trait Implementations§
impl<H, A, C> RefUnwindSafe for Token<H, A, C>
impl<H, A, C> Send for Token<H, A, C>
impl<H, A, C> Sync for Token<H, A, C>
impl<H, A, C> Unpin for Token<H, A, C>
impl<H, A, C> UnwindSafe for Token<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