#[non_exhaustive]pub struct Claims<T> {
pub expires: Option<u64>,
pub id: String,
pub issued_at: u64,
pub issuer: String,
pub subject: String,
pub not_before: Option<u64>,
pub metadata: Option<T>,
}Expand description
Represents a set of RFC 7519 compliant JSON Web Token claims.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.expires: Option<u64>All timestamps in JWTs are stored in seconds since the epoch format
as described as NumericDate in the RFC. Corresponds to the exp field in a JWT.
id: StringCorresponds to the jti field in a JWT.
issued_at: u64The iat field, stored in seconds since the epoch
issuer: StringIssuer of the token, by convention usually the public key of the account that signed the token
subject: StringSubject of the token, usually the public key of the module corresponding to the WebAssembly file being signed
not_before: Option<u64>The nbf JWT field, indicates the time when the token becomes valid. If None token is valid immediately
metadata: Option<T>Custom jwt claims in the wascap namespace
Implementations§
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Claims<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Claims<T>where
T: 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
impl<T> StructuralPartialEq for Claims<T>
Auto Trait Implementations§
impl<T> Freeze for Claims<T>where
T: Freeze,
impl<T> RefUnwindSafe for Claims<T>where
T: RefUnwindSafe,
impl<T> Send for Claims<T>where
T: Send,
impl<T> Sync for Claims<T>where
T: Sync,
impl<T> Unpin for Claims<T>where
T: Unpin,
impl<T> UnwindSafe for Claims<T>where
T: 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