Struct argon2::ParamsBuilder
source · pub struct ParamsBuilder { /* private fields */ }
Expand description
Builder for Argon2 Params
.
Implementations§
source§impl ParamsBuilder
impl ParamsBuilder
sourcepub fn m_cost(&mut self, m_cost: u32) -> &mut Self
pub fn m_cost(&mut self, m_cost: u32) -> &mut Self
Set memory size, expressed in kibibytes, between 8*p_cost
and (2^32)-1.
sourcepub fn t_cost(&mut self, t_cost: u32) -> &mut Self
pub fn t_cost(&mut self, t_cost: u32) -> &mut Self
Set number of iterations, between 1 and (2^32)-1.
sourcepub fn p_cost(&mut self, p_cost: u32) -> &mut Self
pub fn p_cost(&mut self, p_cost: u32) -> &mut Self
Set degree of parallelism, between 1 and (2^24)-1.
sourcepub fn data(&mut self, data: AssociatedData) -> &mut Self
pub fn data(&mut self, data: AssociatedData) -> &mut Self
Set associated data.
sourcepub fn output_len(&mut self, len: usize) -> &mut Self
pub fn output_len(&mut self, len: usize) -> &mut Self
Set length of the output (in bytes).
sourcepub const fn build(&self) -> Result<Params>
pub const fn build(&self) -> Result<Params>
Get the finished Params
.
This performs validations to ensure that the given parameters are valid and compatible with each other, and will return an error if they are not.
sourcepub fn context(
&self,
algorithm: Algorithm,
version: Version
) -> Result<Argon2<'_>>
pub fn context( &self, algorithm: Algorithm, version: Version ) -> Result<Argon2<'_>>
Create a new Argon2
context using the provided algorithm/version.
sourcepub const DEFAULT: ParamsBuilder = _
pub const DEFAULT: ParamsBuilder = _
Default parameters (recommended).
Trait Implementations§
source§impl Clone for ParamsBuilder
impl Clone for ParamsBuilder
source§fn clone(&self) -> ParamsBuilder
fn clone(&self) -> ParamsBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ParamsBuilder
impl Debug for ParamsBuilder
source§impl Default for ParamsBuilder
impl Default for ParamsBuilder
source§impl PartialEq for ParamsBuilder
impl PartialEq for ParamsBuilder
source§fn eq(&self, other: &ParamsBuilder) -> bool
fn eq(&self, other: &ParamsBuilder) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<ParamsBuilder> for Params
impl TryFrom<ParamsBuilder> for Params
impl Eq for ParamsBuilder
impl StructuralEq for ParamsBuilder
impl StructuralPartialEq for ParamsBuilder
Auto Trait Implementations§
impl RefUnwindSafe for ParamsBuilder
impl Send for ParamsBuilder
impl Sync for ParamsBuilder
impl Unpin for ParamsBuilder
impl UnwindSafe for ParamsBuilder
Blanket Implementations§
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
Mutably borrows from an owned value. Read more