Enum password_hash::errors::InvalidValue
source · #[non_exhaustive]
pub enum InvalidValue {
InvalidChar(char),
InvalidFormat,
Malformed,
TooLong,
TooShort,
}
Expand description
Parse errors relating to invalid parameter values or salts.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidChar(char)
Character is not in the allowed set.
InvalidFormat
Format is invalid.
Malformed
Value is malformed.
TooLong
Value exceeds the maximum allowed length.
TooShort
Value does not satisfy the minimum length.
Implementations§
source§impl InvalidValue
impl InvalidValue
sourcepub fn param_error(self) -> Error
pub fn param_error(self) -> Error
Create an Error::ParamValueInvalid
which warps this error.
sourcepub fn salt_error(self) -> Error
pub fn salt_error(self) -> Error
Create an Error::SaltInvalid
which wraps this error.
Trait Implementations§
source§impl Clone for InvalidValue
impl Clone for InvalidValue
source§fn clone(&self) -> InvalidValue
fn clone(&self) -> InvalidValue
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 InvalidValue
impl Debug for InvalidValue
source§impl Display for InvalidValue
impl Display for InvalidValue
source§impl Error for InvalidValue
Available on crate feature std
only.
impl Error for InvalidValue
Available on crate feature
std
only.1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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 PartialEq<InvalidValue> for InvalidValue
impl PartialEq<InvalidValue> for InvalidValue
source§fn eq(&self, other: &InvalidValue) -> bool
fn eq(&self, other: &InvalidValue) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.