pub struct JwtClaims {
pub sub: String,
pub exp: u64,
pub iat: u64,
pub nbf: Option<u64>,
pub jti: String,
pub iss: String,
pub aud: String,
pub roles: Option<Vec<String>>,
pub metadata: Option<HashMap<String, Value>>,
}Expand description
JWT claims structure
Fields§
§sub: StringSubject (user ID)
exp: u64Expiration time
iat: u64Issued at time
nbf: Option<u64>Not before time
jti: StringJWT ID
iss: StringIssuer
aud: StringAudience
roles: Option<Vec<String>>Custom roles
metadata: Option<HashMap<String, Value>>Custom metadata
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for JwtClaims
impl<'de> Deserialize<'de> for JwtClaims
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 Freeze for JwtClaims
impl RefUnwindSafe for JwtClaims
impl Send for JwtClaims
impl Sync for JwtClaims
impl Unpin for JwtClaims
impl UnwindSafe for JwtClaims
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