pub enum HashAlgorithm {
Bcrypt,
Argon2,
}Expand description
Password-hashing algorithm used when writing new password hashes.
Existing hashes are auto-detected and verified using whichever algorithm
produced them, regardless of the configured value here. The configured
value only governs create_user and change_password.
Variants§
Bcrypt
bcrypt with the bcrypt crate’s DEFAULT_COST. Backwards-compatible default.
Argon2
argon2id with the argon2 crate’s defaults (RFC 9106 second-recommended parameters: m = 19 MiB, t = 2, p = 1).
Implementations§
Source§impl HashAlgorithm
impl HashAlgorithm
Sourcepub fn from_config_str(s: &str) -> Result<Self>
pub fn from_config_str(s: &str) -> Result<Self>
Parse a config-string into a HashAlgorithm.
Accepts "bcrypt" (case-insensitive) and "argon2" /
"argon2id" (case-insensitive). Any other value is an error.
Trait Implementations§
Source§impl Clone for HashAlgorithm
impl Clone for HashAlgorithm
Source§fn clone(&self) -> HashAlgorithm
fn clone(&self) -> HashAlgorithm
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 HashAlgorithm
impl Debug for HashAlgorithm
Source§impl Default for HashAlgorithm
impl Default for HashAlgorithm
Source§fn default() -> HashAlgorithm
fn default() -> HashAlgorithm
Returns the “default value” for a type. Read more
Source§impl PartialEq for HashAlgorithm
impl PartialEq for HashAlgorithm
Source§fn eq(&self, other: &HashAlgorithm) -> bool
fn eq(&self, other: &HashAlgorithm) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for HashAlgorithm
impl Eq for HashAlgorithm
impl StructuralPartialEq for HashAlgorithm
Auto Trait Implementations§
impl Freeze for HashAlgorithm
impl RefUnwindSafe for HashAlgorithm
impl Send for HashAlgorithm
impl Sync for HashAlgorithm
impl Unpin for HashAlgorithm
impl UnsafeUnpin for HashAlgorithm
impl UnwindSafe for HashAlgorithm
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more