pub struct JwtClaims<CustomClaims> {
pub registered_claims: RegisteredClaims,
pub custom_claims: CustomClaims,
}Expand description
Combination of claims used within axum-gate and encoded with JsonWebToken codec.
Fields§
§registered_claims: RegisteredClaimsThe registered claims of a JWT.
custom_claims: CustomClaimsYour custom claims that are added to the JWT.
Implementations§
Source§impl<CustomClaims> JwtClaims<CustomClaims>
impl<CustomClaims> JwtClaims<CustomClaims>
Sourcepub fn new(
custom_claims: CustomClaims,
registered_claims: RegisteredClaims,
) -> Self
pub fn new( custom_claims: CustomClaims, registered_claims: RegisteredClaims, ) -> Self
Creates new claims with the given registered claims.
Sourcepub fn has_issuer(&self, issuer: &str) -> bool
pub fn has_issuer(&self, issuer: &str) -> bool
Checks whether the issuer equals to the given value.
Trait Implementations§
Source§impl<'de, CustomClaims> Deserialize<'de> for JwtClaims<CustomClaims>where
CustomClaims: Deserialize<'de>,
impl<'de, CustomClaims> Deserialize<'de> for JwtClaims<CustomClaims>where
CustomClaims: Deserialize<'de>,
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
Auto Trait Implementations§
impl<CustomClaims> Freeze for JwtClaims<CustomClaims>where
CustomClaims: Freeze,
impl<CustomClaims> RefUnwindSafe for JwtClaims<CustomClaims>where
CustomClaims: RefUnwindSafe,
impl<CustomClaims> Send for JwtClaims<CustomClaims>where
CustomClaims: Send,
impl<CustomClaims> Sync for JwtClaims<CustomClaims>where
CustomClaims: Sync,
impl<CustomClaims> Unpin for JwtClaims<CustomClaims>where
CustomClaims: Unpin,
impl<CustomClaims> UnwindSafe for JwtClaims<CustomClaims>where
CustomClaims: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more