Struct password_hash::ParamsString[][src]

pub struct ParamsString(_);

Algorithm parameter string.

The PHC string format specification defines a set of optional algorithm-specific name/value pairs which can be encoded into a PHC-formatted parameter string as follows:

$<param>=<value>(,<param>=<value>)*

This type represents that set of parameters.

Implementations

impl ParamsString[src]

pub fn new() -> Self[src]

Create new empty ParamsString.

pub fn add_str<'a>(
    &mut self,
    name: impl TryInto<Ident<'a>>,
    value: impl TryInto<Value<'a>>
) -> Result<(), ParamsError>
[src]

Add a key/value pair with a string value to the ParamsString.

pub fn add_decimal<'a>(
    &mut self,
    name: impl TryInto<Ident<'a>>,
    value: Decimal
) -> Result<(), ParamsError>
[src]

Add a key/value pair with a decimal value to the ParamsString.

pub fn as_bytes(&self) -> &[u8][src]

Borrow the contents of this ParamsString as a byte slice.

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

Borrow the contents of this ParamsString as a str.

pub fn len(&self) -> usize[src]

Get the count of the number ASCII characters in this ParamsString.

pub fn is_empty(&self) -> bool[src]

Is this set of parameters empty?

pub fn iter(&self) -> Iter<'_>[src]

Iterate over the parameters.

pub fn get<'a>(&self, name: impl TryInto<Ident<'a>>) -> Option<Value<'_>>[src]

Get a parameter Value by name.

pub fn get_str<'a>(&self, name: impl TryInto<Ident<'a>>) -> Option<&str>[src]

Get a parameter as a str.

pub fn get_decimal<'a>(&self, name: impl TryInto<Ident<'a>>) -> Option<Decimal>[src]

Get a parameter as a Decimal.

See Value::decimal for format information.

Trait Implementations

impl Clone for ParamsString[src]

impl Debug for ParamsString[src]

impl Default for ParamsString[src]

impl Display for ParamsString[src]

impl Eq for ParamsString[src]

impl<'a> FromIterator<(Ident<'a>, Value<'a>)> for ParamsString[src]

impl FromStr for ParamsString[src]

type Err = ParamsError

The associated error which can be returned from parsing.

impl PartialEq<ParamsString> for ParamsString[src]

impl StructuralEq for ParamsString[src]

impl StructuralPartialEq for ParamsString[src]

Auto Trait Implementations

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.