pub struct InvalidHash;Expand description
Error returned by verify when the supplied hash string is not a
well-formed SHA512-crypt ($6$…$…) value.
This is distinct from a simple password mismatch: a mismatch is reported
as Ok(false), while a malformed hash is reported as Err(InvalidHash).
Distinguishing these cases is particularly useful when a credential
store contains hashes from multiple algorithms (e.g. a legacy table
holding a mix of $1$ MD5-crypt, $2y$ bcrypt, $5$ SHA256-crypt,
and $6$ SHA512-crypt entries, or rows migrated from another system).
Err(InvalidHash) lets the caller route the request to a different
verifier — or surface data corruption — rather than treating a
non-$6$ hash as a failed authentication attempt.
Trait Implementations§
Source§impl Clone for InvalidHash
impl Clone for InvalidHash
Source§fn clone(&self) -> InvalidHash
fn clone(&self) -> InvalidHash
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 InvalidHash
impl Debug for InvalidHash
Source§impl Display for InvalidHash
impl Display for InvalidHash
Source§impl Error for InvalidHash
impl Error for InvalidHash
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl Hash for InvalidHash
impl Hash for InvalidHash
Source§impl PartialEq for InvalidHash
impl PartialEq for InvalidHash
Source§fn eq(&self, other: &InvalidHash) -> bool
fn eq(&self, other: &InvalidHash) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for InvalidHash
impl Eq for InvalidHash
impl StructuralPartialEq for InvalidHash
Auto Trait Implementations§
impl Freeze for InvalidHash
impl RefUnwindSafe for InvalidHash
impl Send for InvalidHash
impl Sync for InvalidHash
impl Unpin for InvalidHash
impl UnsafeUnpin for InvalidHash
impl UnwindSafe for InvalidHash
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