pub struct Token {
pub version: u8,
pub algorithm: Algorithm,
pub payload: HashMap<String, String>,
pub hash: String,
}Expand description
A struct that holds information about a Delimeter Separated Web Token.
It is not reccomended to create a token directly using this struct,
instead create one through the TokenManager struct.
Fields§
§version: u8version of the token, this is automatically set to the crate version and should not be changed
algorithm: AlgorithmTe algorithm used to hash the payload
payload: HashMap<String, String>payload of the token stored in a hashmap as key-value pairs
hash: Stringhash of the token that gets generated when the token is created, it is used to verify the token is valid this is automatically set when the token is created and should not be changed
Implementations§
Trait Implementations§
source§impl PartialEq for Token
impl PartialEq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
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