Struct password_hash::ParamsString [−][src]
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]
&mut self,
name: impl TryInto<Ident<'a>>,
value: impl TryInto<Value<'a>>
) -> Result<(), ParamsError>
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]
&mut self,
name: impl TryInto<Ident<'a>>,
value: Decimal
) -> Result<(), ParamsError>
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]
fn clone(&self) -> ParamsString
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ParamsString
[src]
impl Default for ParamsString
[src]
fn default() -> ParamsString
[src]
impl Display for ParamsString
[src]
impl Eq for ParamsString
[src]
impl<'a> FromIterator<(Ident<'a>, Value<'a>)> for ParamsString
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = (Ident<'a>, Value<'a>)>,
[src]
I: IntoIterator<Item = (Ident<'a>, Value<'a>)>,
impl FromStr for ParamsString
[src]
type Err = ParamsError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, ParamsError>
[src]
impl PartialEq<ParamsString> for ParamsString
[src]
fn eq(&self, other: &ParamsString) -> bool
[src]
fn ne(&self, other: &ParamsString) -> bool
[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]
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>,