Struct simple_jwt::Claim
[−]
[src]
pub struct Claim { pub registered: RegisteredClaim, pub payload: Map<String, Value>, }
Fields
registered: RegisteredClaim
payload: Map<String, Value>
Methods
impl Claim
[src]
JWT Claim
some util function to set/get fields
Example
use simple_jwt::Claim; let mut claim = Claim::default(); claim.set_iss("some iss"); claim.set_payload_field("sub", "some sub"); println!("{:?}", claim.registered.iss); println!("{:?}", claim.get_payload_field("sub")); // payload is acctually a BTreeMap<String, serde_json::Value> println!("{:?}", claim.payload.get("sub"))
fn set_exp(&mut self, v: u64) -> &mut Claim
[src]
fn set_nbf(&mut self, v: u64) -> &mut Claim
[src]
fn set_iat(&mut self, v: u64) -> &mut Claim
[src]
fn set_iss(&mut self, v: &str) -> &mut Claim
[src]
fn set_aud(&mut self, v: &str) -> &mut Claim
[src]
fn set_sub(&mut self, v: &str) -> &mut Claim
[src]
fn set_jti(&mut self, v: &str) -> &mut Claim
[src]
fn set_payload_field<V: Serialize>(&mut self, key: &str, v: V) -> &mut Claim
[src]
fn get_payload_field(&self, key: &str) -> Option<&Value>
[src]
Trait Implementations
impl Debug for Claim
[src]
impl Default for Claim
[src]
impl PartialEq for Claim
[src]
fn eq(&self, __arg_0: &Claim) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Claim) -> bool
[src]
This method tests for !=
.