pub struct Claims<E> {
pub sub: String,
pub session_id: String,
pub exp: usize,
pub ext: E,
}Expand description
JWT payload, generic over an app-defined extension type E for custom claims.
Fields§
§sub: StringSubject (typically the app’s typed ID as a string)
session_id: StringSession ID (optional, for tracking sessions)
exp: usizeExpiration time (as UTC timestamp)
ext: EApp-defined extensions (e.g., email, role, custom claims)
Trait Implementations§
Source§impl<'de, E> Deserialize<'de> for Claims<E>where
E: Deserialize<'de>,
impl<'de, E> Deserialize<'de> for Claims<E>where
E: 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
Auto Trait Implementations§
impl<E> Freeze for Claims<E>where
E: Freeze,
impl<E> RefUnwindSafe for Claims<E>where
E: RefUnwindSafe,
impl<E> Send for Claims<E>where
E: Send,
impl<E> Sync for Claims<E>where
E: Sync,
impl<E> Unpin for Claims<E>where
E: Unpin,
impl<E> UnsafeUnpin for Claims<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for Claims<E>where
E: UnwindSafe,
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