Struct dswt::TokenManager
source · pub struct TokenManager {
pub algorithm: Algorithm,
/* private fields */
}Expand description
A struct that manages the creation and validation of tokens created with a given key and algorithm
Fields§
§algorithm: AlgorithmAlgorithm used to hash the payload
Implementations§
source§impl TokenManager
impl TokenManager
sourcepub fn new(alg: Algorithm, key: &str) -> TokenManager
pub fn new(alg: Algorithm, key: &str) -> TokenManager
Function to create a new TokenManager
sourcepub fn validate_token(&self, token: &Token) -> bool
pub fn validate_token(&self, token: &Token) -> bool
Validate a token
Trait Implementations§
source§impl Clone for TokenManager
impl Clone for TokenManager
source§fn clone(&self) -> TokenManager
fn clone(&self) -> TokenManager
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for TokenManager
impl Debug for TokenManager
source§impl PartialEq for TokenManager
impl PartialEq for TokenManager
source§fn eq(&self, other: &TokenManager) -> bool
fn eq(&self, other: &TokenManager) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for TokenManager
Auto Trait Implementations§
impl Freeze for TokenManager
impl RefUnwindSafe for TokenManager
impl Send for TokenManager
impl Sync for TokenManager
impl Unpin for TokenManager
impl UnwindSafe for TokenManager
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