Struct medallion::Payload
[−]
[src]
pub struct Payload<T: Serialize + Deserialize + PartialEq> { 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 + Deserialize + PartialEq> Payload<T>
[src]
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.
fn to_base64(&self) -> Result<String>
Renders both the standard and custom claims into a single consolidated JSON representation before encoding.