Struct bonsaidb::local::argon2::password_hash::ParamsString
pub struct ParamsString(_);
Expand description
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
impl ParamsString
pub fn new() -> ParamsString
pub fn new() -> ParamsString
Create new empty ParamsString
.
pub fn add_b64_bytes<'a>(
&mut self,
name: impl TryInto<Ident<'a>>,
bytes: &[u8]
) -> Result<(), Error>
pub fn add_b64_bytes<'a>( &mut self, name: impl TryInto<Ident<'a>>, bytes: &[u8] ) -> Result<(), Error>
Add the given byte value to the ParamsString
, encoding it as “B64”.
pub fn add_decimal<'a>(
&mut self,
name: impl TryInto<Ident<'a>>,
value: u32
) -> Result<(), Error>
pub fn add_decimal<'a>( &mut self, name: impl TryInto<Ident<'a>>, value: u32 ) -> Result<(), Error>
Add a key/value pair with a decimal value to the ParamsString
.
pub fn add_str<'a>(
&mut self,
name: impl TryInto<Ident<'a>>,
value: impl TryInto<Value<'a>>
) -> Result<(), Error>
pub fn add_str<'a>( &mut self, name: impl TryInto<Ident<'a>>, value: impl TryInto<Value<'a>> ) -> Result<(), Error>
Add a key/value pair with a string value to the ParamsString
.
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
Borrow the contents of this ParamsString
as a byte slice.
pub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Borrow the contents of this ParamsString
as a str
.
pub fn len(&self) -> usize
pub fn len(&self) -> usize
Get the count of the number ASCII characters in this ParamsString
.
pub fn iter(&self) -> Iter<'_>
pub fn iter(&self) -> Iter<'_>
Iterate over the parameters.
pub fn get<'a>(&self, name: impl TryInto<Ident<'a>>) -> Option<Value<'_>>
pub fn get<'a>(&self, name: impl TryInto<Ident<'a>>) -> Option<Value<'_>>
Get a parameter Value
by name.
pub fn get_decimal<'a>(&self, name: impl TryInto<Ident<'a>>) -> Option<u32>
pub fn get_decimal<'a>(&self, name: impl TryInto<Ident<'a>>) -> Option<u32>
Get a parameter as a Decimal
.
See Value::decimal
for format information.
Trait Implementations§
§impl Clone for ParamsString
impl Clone for ParamsString
§fn clone(&self) -> ParamsString
fn clone(&self) -> ParamsString
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for ParamsString
impl Debug for ParamsString
§impl Default for ParamsString
impl Default for ParamsString
§fn default() -> ParamsString
fn default() -> ParamsString
§impl Display for ParamsString
impl Display for ParamsString
§impl<'a> FromIterator<(Ident<'a>, Value<'a>)> for ParamsString
impl<'a> FromIterator<(Ident<'a>, Value<'a>)> for ParamsString
§fn from_iter<I>(iter: I) -> ParamsStringwhere
I: IntoIterator<Item = (Ident<'a>, Value<'a>)>,
fn from_iter<I>(iter: I) -> ParamsStringwhere I: IntoIterator<Item = (Ident<'a>, Value<'a>)>,
§impl FromStr for ParamsString
impl FromStr for ParamsString
§impl PartialEq<ParamsString> for ParamsString
impl PartialEq<ParamsString> for ParamsString
§fn eq(&self, other: &ParamsString) -> bool
fn eq(&self, other: &ParamsString) -> bool
self
and other
values to be equal, and is used
by ==
.§impl TryFrom<&Params> for ParamsString
impl TryFrom<&Params> for ParamsString
§impl TryFrom<Params> for ParamsString
impl TryFrom<Params> for ParamsString
impl Eq for ParamsString
impl StructuralEq for ParamsString
impl StructuralPartialEq for ParamsString
Auto Trait Implementations§
impl RefUnwindSafe for ParamsString
impl Send for ParamsString
impl Sync for ParamsString
impl Unpin for ParamsString
impl UnwindSafe for ParamsString
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.