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>

source

pub fn expires(&self) -> SystemTime

Check the expiration time of this SignedToken.

source

pub fn get_claim(&self, host: &H, actor: &A) -> Option<&C>
where H: PartialEq, A: PartialEq,

Borrow the latest (most recent) claim by the given actor on the given host.

source

pub fn first_claim<Cond>(&self, cond: Cond) -> Option<(&H, &A, &C)>
where H: PartialEq, A: PartialEq, Cond: Fn((&H, &A, &C)) -> bool,

Borrow the earliest claim which matches the given condition.

source

pub fn last_claim<Cond>(&self, cond: Cond) -> Option<(&H, &A, &C)>
where H: PartialEq, A: PartialEq, Cond: Fn((&H, &A, &C)) -> bool,

Borrow the latest claim which matches the given condition.

source

pub fn jwt(&self) -> &str

Borrow the signed, encoded representation of this token.

source

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>

source§

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)

Performs copy-assignment from source. Read more
source§

impl<H: Debug, A: Debug, C: Debug> Debug for SignedToken<H, A, C>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<H: PartialEq, A: PartialEq, C: PartialEq> PartialEq for SignedToken<H, A, C>

source§

fn eq(&self, other: &SignedToken<H, A, C>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<H: Eq, A: Eq, C: Eq> Eq for SignedToken<H, A, C>

source§

impl<H, A, C> StructuralEq for SignedToken<H, A, C>

source§

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>
where A: Send, C: Send, H: Send,

§

impl<H, A, C> Sync for SignedToken<H, A, C>
where A: Sync, C: Sync, H: Sync,

§

impl<H, A, C> Unpin for SignedToken<H, A, C>
where A: Unpin, C: Unpin, H: Unpin,

§

impl<H, A, C> UnwindSafe for SignedToken<H, A, C>
where A: UnwindSafe, C: UnwindSafe, H: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V