Struct medallion::Payload [−][src]
pub struct Payload<T = ()> { pub iss: Option<String>, pub sub: Option<String>, pub aud: Option<String>, pub exp: Option<u64>, pub nbf: Option<u64>, pub iat: Option<u64>, pub jti: Option<String>, pub claims: Option<T>, }
A default claim set, including the standard, or registered, claims and the ability to specify your own as custom claims.
Fields
iss: Option<String>
sub: Option<String>
aud: Option<String>
exp: Option<u64>
nbf: Option<u64>
iat: Option<u64>
jti: Option<String>
claims: Option<T>
Methods
impl<T: Serialize + DeserializeOwned> Payload<T>
[src]
impl<T: Serialize + DeserializeOwned> Payload<T>
pub fn from_base64(raw: &str) -> Result<Payload<T>>
[src]
pub fn from_base64(raw: &str) -> Result<Payload<T>>
This implementation simply parses the base64 data twice, first parsing out the standard claims then any custom claims, assigning the latter into a copy of the former before returning registered and custom claims.
pub fn to_base64(&self) -> Result<String>
[src]
pub fn to_base64(&self) -> Result<String>
Renders both the standard and custom claims into a single consolidated JSON representation before encoding.
pub fn verify(&self) -> bool
[src]
pub fn verify(&self) -> bool
Trait Implementations
impl<T: Debug> Debug for Payload<T>
[src]
impl<T: Debug> Debug for Payload<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Default> Default for Payload<T>
[src]
impl<T: Default> Default for Payload<T>
impl<T: PartialEq> PartialEq for Payload<T>
[src]
impl<T: PartialEq> PartialEq for Payload<T>