pub enum AuthData<T: Serialize + DeserializeOwned = ()> {
None,
Text(String),
Number(f64),
TextNumber(String, f64),
Structured(T),
}Expand description
The data in the JWT.
This stores any data attached to a logged in user. This data is not secret - it can be ready by the receiver. The authenticity of the message is however always conserved (as long as your secret hasn’t leaked).
Variants§
None
No data.
Text(String)
Text data.
Number(f64)
A number.
TextNumber(String, f64)
Text and a number.
Structured(T)
Fields iat, exp, and __variant are overriden and will not be visible when the
JWT is decoded.
This panics when the serde feature is not enabled.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for AuthData<T>where
T: Freeze,
impl<T> RefUnwindSafe for AuthData<T>where
T: RefUnwindSafe,
impl<T> Send for AuthData<T>where
T: Send,
impl<T> Sync for AuthData<T>where
T: Sync,
impl<T> Unpin for AuthData<T>where
T: Unpin,
impl<T> UnwindSafe for AuthData<T>where
T: 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