pub struct Passwords { /* private fields */ }Expand description
Runs a PasswordHasher on the blocking pool behind a semaphore, so a burst of sign-ins
can’t allocate unbounded argon2 memory.
Implementations§
Source§impl Passwords
impl Passwords
pub fn new(hasher: Arc<dyn PasswordHasher>) -> Self
pub async fn hash(&self, password: &str) -> Result<String, String>
pub async fn verify(&self, password: &str, hash: &str) -> Result<bool, String>
pub fn needs_rehash(&self, hash: &str) -> bool
Sourcepub async fn verify_dummy(&self, password: &str)
pub async fn verify_dummy(&self, password: &str)
Spends the same time as a real verification, for unknown emails.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Passwords
impl !UnwindSafe for Passwords
impl Forget for Passwords
impl Freeze for Passwords
impl Move for Passwords
impl Send for Passwords
impl Sync for Passwords
impl Unpin for Passwords
impl UnsafeUnpin for Passwords
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