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: u64

Expiration 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: AccountId

Subject (whom token refers to)

Implementations§

source§

impl<AccountId, Fields> AccountSessionClaims<AccountId, Fields>

source

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>

source

pub fn new( state: AccountSessionState<AccountId, Fields>, iss: impl Into<Cow<'static, str>>, exp: NaiveDateTime ) -> Self

source

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>

source

pub fn aud(self, aud: impl Into<Cow<'static, str>>) -> Self

source

pub fn exp(self, exp: NaiveDateTime) -> Self

source

pub fn exp_in(self, exp_in: Duration) -> Self

source

pub fn iat(self, iat: NaiveDateTime) -> Self

source

pub fn iss(self, iss: impl Into<Cow<'static, str>>) -> Self

source

pub fn nbf(self, nbf: NaiveDateTime) -> Self

source

pub fn nbf_in(self, nbf_in: Duration) -> Self

source

pub fn state<NewAccountId: Clone, NewFields>( self, state: AccountSessionState<NewAccountId, NewFields> ) -> AccountSessionClaims<NewAccountId, NewFields>

source§

impl<AccountId: Serialize, Fields: Serialize> AccountSessionClaims<AccountId, Fields>

source

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>

source§

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)

Performs copy-assignment from source. Read more
source§

impl<AccountId: Debug, Fields: Debug> Debug for AccountSessionClaims<AccountId, Fields>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<AccountId, Fields> Deref for AccountSessionClaims<AccountId, Fields>

§

type Target = AccountSessionState<AccountId, Fields>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

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>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<AccountId: PartialEq, Fields: PartialEq> PartialEq<AccountSessionClaims<AccountId, Fields>> for AccountSessionClaims<AccountId, Fields>

source§

fn eq(&self, other: &AccountSessionClaims<AccountId, Fields>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<AccountId, Fields> Serialize for AccountSessionClaims<AccountId, Fields>where AccountId: Serialize, Fields: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<AccountId: Eq, Fields: Eq> Eq for AccountSessionClaims<AccountId, Fields>

source§

impl<AccountId, Fields> StructuralEq for AccountSessionClaims<AccountId, Fields>

source§

impl<AccountId, Fields> StructuralPartialEq for AccountSessionClaims<AccountId, Fields>

Auto Trait Implementations§

§

impl<AccountId, Fields> RefUnwindSafe for AccountSessionClaims<AccountId, Fields>where AccountId: RefUnwindSafe, Fields: RefUnwindSafe,

§

impl<AccountId, Fields> Send for AccountSessionClaims<AccountId, Fields>where AccountId: Send, Fields: Send,

§

impl<AccountId, Fields> Sync for AccountSessionClaims<AccountId, Fields>where AccountId: Sync, Fields: Sync,

§

impl<AccountId, Fields> Unpin for AccountSessionClaims<AccountId, Fields>where AccountId: Unpin, Fields: Unpin,

§

impl<AccountId, Fields> UnwindSafe for AccountSessionClaims<AccountId, Fields>where AccountId: UnwindSafe, Fields: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromRef<T> for Twhere T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,

§

impl<T> Formattable for Twhere T: Deref, <T as Deref>::Target: Formattable,

§

impl<T> Parsable for Twhere T: Deref, <T as Deref>::Target: Parsable,