PasswordHashRef

Struct PasswordHashRef 

Source
pub struct PasswordHashRef(/* private fields */);
Available on crate feature password-hash only.
Expand description

Password hash reference type for hashes encoded in the Modular Crypt Format (MCF), e.g. $<id>$....

For more information, see PasswordHash.

Implementations§

Source§

impl PasswordHashRef

Source

pub fn new(s: &str) -> Result<&PasswordHashRef, Error>

Parse the given input string, returning an PasswordHashRef if valid.

Source

pub fn as_str(&self) -> &str

Get the contained string as a str.

Source

pub fn id(&self) -> &str

Get the algorithm identifier for this MCF hash.

Source

pub fn fields(&self) -> Fields<'_>

Get an iterator over the parts of the password hash as delimited by $, excluding the initial identifier.

Trait Implementations§

Source§

impl AsRef<PasswordHashRef> for PasswordHash

Source§

fn as_ref(&self) -> &PasswordHashRef

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<str> for &PasswordHashRef

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<PasswordHashRef> for PasswordHash

Source§

fn borrow(&self) -> &PasswordHashRef

Immutably borrows from an owned value. Read more
Source§

impl Debug for PasswordHashRef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for PasswordHashRef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a> From<&'a PasswordHash> for &'a PasswordHashRef

Source§

fn from(hash: &'a PasswordHash) -> &'a PasswordHashRef

Converts to this type from the input type.
Source§

impl<'a> From<&'a PasswordHashRef> for &'a str

Source§

fn from(hash: &'a PasswordHashRef) -> &'a str

Converts to this type from the input type.
Source§

impl From<&PasswordHashRef> for PasswordHash

Source§

fn from(hash: &PasswordHashRef) -> PasswordHash

Converts to this type from the input type.
Source§

impl Ord for PasswordHashRef

Source§

fn cmp(&self, other: &PasswordHashRef) -> Ordering

This method returns an Ordering between self and other. Read more
Source§

impl PartialEq for PasswordHashRef

Source§

fn eq(&self, other: &PasswordHashRef) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for PasswordHashRef

Source§

fn partial_cmp(&self, other: &PasswordHashRef) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PasswordVerifier<PasswordHashRef> for Yescrypt

Source§

fn verify_password(&self, password: &[u8], hash: &PasswordHashRef) -> Result<()>

Compute this password hashing function against the provided password using the parameters from the provided password hash and see if the computed output matches.
Source§

impl ToOwned for PasswordHashRef

Source§

type Owned = PasswordHash

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> PasswordHash

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<'a> TryFrom<&'a str> for &'a PasswordHashRef

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(s: &'a str) -> Result<&'a PasswordHashRef, Error>

Performs the conversion.
Source§

impl Eq for PasswordHashRef

Source§

impl StructuralPartialEq for PasswordHashRef

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more