Struct authzen_session::AccountSessionClaims
source · pub struct AccountSessionClaims<AccountId, Fields = ()> {
pub aud: Option<Cow<'static, str>>,
pub exp: u64,
pub iat: Option<u64>,
pub iss: Cow<'static, str>,
pub nbf: Option<u64>,
pub state: AccountSessionState<AccountId, Fields>,
pub sub: AccountId,
}Fields§
§aud: Option<Cow<'static, str>>Audience
exp: u64Expiration time (as UTC seconds timestamp, validate_exp defaults to true in validation)
iat: Option<u64>Issued at (as UTC seconds timestamp)
iss: Cow<'static, str>Issuer
nbf: Option<u64>Not Before (as UTC seconds timestamp)
state: AccountSessionState<AccountId, Fields>Session state
sub: AccountIdSubject (whom token refers to)
Implementations§
source§impl<AccountId, Fields> AccountSessionClaims<AccountId, Fields>
impl<AccountId, Fields> AccountSessionClaims<AccountId, Fields>
sourcepub fn builder(
) -> AccountSessionClaimsBuilder<((), (), (), (), (), (), ()), AccountId, Fields>
pub fn builder( ) -> AccountSessionClaimsBuilder<((), (), (), (), (), (), ()), AccountId, Fields>
Create a builder for building AccountSessionClaims.
On the builder, call .aud(...)(optional), .exp(...), .iat(...), .iss(...), .nbf(...), .state(...), .sub(...) to set the values of the fields.
Finally, call .build() to create the instance of AccountSessionClaims.
source§impl<AccountId: Clone, Fields> AccountSessionClaims<AccountId, Fields>
impl<AccountId: Clone, Fields> AccountSessionClaims<AccountId, Fields>
pub fn new( state: AccountSessionState<AccountId, Fields>, iss: impl Into<Cow<'static, str>>, exp: NaiveDateTime ) -> Self
pub fn new_exp_in( state: AccountSessionState<AccountId, Fields>, iss: impl Into<Cow<'static, str>>, exp_in: Duration ) -> Self
source§impl<AccountId, Fields> AccountSessionClaims<AccountId, Fields>
impl<AccountId, Fields> AccountSessionClaims<AccountId, Fields>
pub fn aud(self, aud: impl Into<Cow<'static, str>>) -> Self
pub fn exp(self, exp: NaiveDateTime) -> Self
pub fn exp_in(self, exp_in: Duration) -> Self
pub fn iat(self, iat: NaiveDateTime) -> Self
pub fn iss(self, iss: impl Into<Cow<'static, str>>) -> Self
pub fn nbf(self, nbf: NaiveDateTime) -> Self
pub fn nbf_in(self, nbf_in: Duration) -> Self
pub fn state<NewAccountId: Clone, NewFields>( self, state: AccountSessionState<NewAccountId, NewFields> ) -> AccountSessionClaims<NewAccountId, NewFields>
source§impl<AccountId: Serialize, Fields: Serialize> AccountSessionClaims<AccountId, Fields>
impl<AccountId: Serialize, Fields: Serialize> AccountSessionClaims<AccountId, Fields>
pub fn encode( self, header: &Header, encoding_key: &EncodingKey ) -> Result<AccountSessionToken<()>, Error>
Trait Implementations§
source§impl<AccountId: Clone, Fields: Clone> Clone for AccountSessionClaims<AccountId, Fields>
impl<AccountId: Clone, Fields: Clone> Clone for AccountSessionClaims<AccountId, Fields>
source§fn clone(&self) -> AccountSessionClaims<AccountId, Fields>
fn clone(&self) -> AccountSessionClaims<AccountId, Fields>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<AccountId, Fields> Deref for AccountSessionClaims<AccountId, Fields>
impl<AccountId, Fields> Deref for AccountSessionClaims<AccountId, Fields>
source§impl<'de, AccountId, Fields> Deserialize<'de> for AccountSessionClaims<AccountId, Fields>where
AccountId: Deserialize<'de>,
Fields: Deserialize<'de>,
impl<'de, AccountId, Fields> Deserialize<'de> for AccountSessionClaims<AccountId, Fields>where AccountId: Deserialize<'de>, Fields: 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
source§impl<AccountId: PartialEq, Fields: PartialEq> PartialEq<AccountSessionClaims<AccountId, Fields>> for AccountSessionClaims<AccountId, Fields>
impl<AccountId: PartialEq, Fields: PartialEq> PartialEq<AccountSessionClaims<AccountId, Fields>> for AccountSessionClaims<AccountId, Fields>
source§fn eq(&self, other: &AccountSessionClaims<AccountId, Fields>) -> bool
fn eq(&self, other: &AccountSessionClaims<AccountId, Fields>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.