pub struct TokenClaims {
pub issuer: String,
pub subject: String,
pub audience: Vec<String>,
}Fields§
§issuer: String§subject: String§audience: Vec<String>Implementations§
Source§impl TokenClaims
impl TokenClaims
pub fn new(issuer: String, subject: String) -> Self
pub fn id(&self) -> Identity
pub fn encode_and_sign_with_expiry( &self, signer: &impl TokenSigner, expiry: Option<Duration>, ) -> Result<String, JwtError>
pub fn encode_and_sign( &self, signer: &impl TokenSigner, ) -> Result<String, JwtError>
Trait Implementations§
Source§impl From<SpacetimeAuth> for TokenClaims
impl From<SpacetimeAuth> for TokenClaims
Source§fn from(claims: SpacetimeAuth) -> Self
fn from(claims: SpacetimeAuth) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TokenClaims
impl RefUnwindSafe for TokenClaims
impl Send for TokenClaims
impl Sync for TokenClaims
impl Unpin for TokenClaims
impl UnwindSafe for TokenClaims
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more