Struct password_hash::Ident[][src]

pub struct Ident<'a>(_);

Algorithm or parameter identifier.

This type encompasses both the "function symbolic name" and "parameter name" use cases as described in the PHC string format specification.

Constraints

  • ASCII-encoded string consisting of the characters [a-z0-9-] (lowercase letters, digits, and the minus sign)
  • Minimum length: 1 ASCII character (i.e. 1-byte)
  • Maximum length: 32 ASCII characters (i.e. 32-bytes)

Implementations

impl<'a> Ident<'a>[src]

pub const fn max_len() -> usize[src]

Maximum length of an Ident - 32 ASCII characters (i.e. 32-bytes).

This value corresponds to the maximum size of a function symbolic names and parameter names according to the PHC string format.

pub const fn new(s: &'a str) -> Self[src]

Parse an Ident from a string.

Panics

Must conform to the contraints given in the type-level documentation, or else it will panic.

This method is intended for use in a const context where instead of panicking it will cause a compile error.

For fallible non-panicking parsing of an Ident, use the TryFrom impl on this type instead.

pub fn as_str(&self) -> &'a str[src]

Borrow this ident as a str

Trait Implementations

impl<'a> AsRef<str> for Ident<'a>[src]

impl<'a> Clone for Ident<'a>[src]

impl<'a> Copy for Ident<'a>[src]

impl<'a> Debug for Ident<'a>[src]

impl<'a> Deref for Ident<'a>[src]

type Target = str

The resulting type after dereferencing.

impl<'a> Display for Ident<'a>[src]

impl<'a> Eq for Ident<'a>[src]

impl<'a> Hash for Ident<'a>[src]

impl<'a> Ord for Ident<'a>[src]

impl<'a> PartialEq<Ident<'a>> for Ident<'a>[src]

impl<'a> PartialOrd<Ident<'a>> for Ident<'a>[src]

impl<'a> StructuralEq for Ident<'a>[src]

impl<'a> StructuralPartialEq for Ident<'a>[src]

impl<'a> TryFrom<&'a str> for Ident<'a>[src]

type Error = ParseError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<'a> Send for Ident<'a>[src]

impl<'a> Sync for Ident<'a>[src]

impl<'a> Unpin for Ident<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.