pub struct JwtClaims { /* private fields */ }Expand description
Claims extracted from a JWT token.
By default, looks for sub, roles, and permissions claims.
All other claims are accessible via claims() as stringified values.
Implementations§
Trait Implementations§
Source§impl IClaims for JwtClaims
impl IClaims for JwtClaims
Source§fn permissions(&self) -> &[String]
fn permissions(&self) -> &[String]
Permissions assigned to the user.
Source§fn get_userid(&self) -> &str
fn get_userid(&self) -> &str
Alias for
subject() — returns the user identifier.Source§fn get_username(&self) -> Option<&str>
fn get_username(&self) -> Option<&str>
Read the display name from the raw claims map (key
"name").
Returns None when absent.Source§fn get_tenantid(&self) -> Option<&str>
fn get_tenantid(&self) -> Option<&str>
Read the tenant identifier from the raw claims map (key
"tenant_id").
Returns None when absent.Auto Trait Implementations§
impl Freeze for JwtClaims
impl RefUnwindSafe for JwtClaims
impl Send for JwtClaims
impl Sync for JwtClaims
impl Unpin for JwtClaims
impl UnsafeUnpin for JwtClaims
impl UnwindSafe for JwtClaims
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