Struct password_hash::Ident [−][src]
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]
fn clone(&self) -> Ident<'a>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Copy for Ident<'a>
[src]
impl<'a> Debug for Ident<'a>
[src]
impl<'a> Deref for Ident<'a>
[src]
impl<'a> Display for Ident<'a>
[src]
impl<'a> Eq for Ident<'a>
[src]
impl<'a> Hash for Ident<'a>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a> Ord for Ident<'a>
[src]
fn cmp(&self, other: &Ident<'a>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<'a> PartialEq<Ident<'a>> for Ident<'a>
[src]
impl<'a> PartialOrd<Ident<'a>> for Ident<'a>
[src]
fn partial_cmp(&self, other: &Ident<'a>) -> Option<Ordering>
[src]
fn lt(&self, other: &Ident<'a>) -> bool
[src]
fn le(&self, other: &Ident<'a>) -> bool
[src]
fn gt(&self, other: &Ident<'a>) -> bool
[src]
fn ge(&self, other: &Ident<'a>) -> bool
[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.
fn try_from(s: &'a str) -> Result<Self, ParseError>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,