pub struct Hasher { /* private fields */ }Expand description
API key hasher and issuer.
The HMAC key is validated and pre-initialized at construction time so that
digest and compare are fully infallible at call time.
Implementations§
Source§impl Hasher
impl Hasher
Sourcepub fn new(config: HashingConfig) -> AppResult<Self>
pub fn new(config: HashingConfig) -> AppResult<Self>
Construct a new hasher, validating config and pre-initializing the HMAC key.
Sourcepub const fn config(&self) -> &HashingConfig
pub const fn config(&self) -> &HashingConfig
Return the active configuration.
Sourcepub fn generate_key(&self, prefix: &str) -> AppResult<GenerateResult>
pub fn generate_key(&self, prefix: &str) -> AppResult<GenerateResult>
Generate a new API key with the supplied prefix.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Hasher
impl RefUnwindSafe for Hasher
impl Send for Hasher
impl Sync for Hasher
impl Unpin for Hasher
impl UnsafeUnpin for Hasher
impl UnwindSafe for Hasher
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