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)>
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 PartialEq for InvalidValue
impl PartialEq for InvalidValue
impl Copy for InvalidValue
impl Eq for InvalidValue
impl StructuralPartialEq for InvalidValue
Auto Trait Implementations§
impl Freeze for InvalidValue
impl RefUnwindSafe for InvalidValue
impl Send for InvalidValue
impl Sync for InvalidValue
impl Unpin for InvalidValue
impl UnwindSafe for InvalidValue
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)