pub struct Argon2Config {
pub memory_kib: u32,
pub time_cost: u32,
pub parallelism: u32,
}Expand description
Argon2 parameter configuration (memory in KiB).
Fields§
§memory_kib: u32Memory usage in KiB for the Argon2 algorithm.
time_cost: u32Number of iterations (time cost) for the Argon2 algorithm.
parallelism: u32Number of parallel threads to use during hashing.
Implementations§
Source§impl Argon2Config
impl Argon2Config
Sourcepub fn high_security() -> Self
pub fn high_security() -> Self
High security configuration for production environments.
Uses 64 MiB memory, 3 iterations, and 1 thread for maximum security.
Sourcepub fn interactive() -> Self
pub fn interactive() -> Self
Interactive configuration balanced for user-facing applications.
Uses 32 MiB memory, 2 iterations, and 1 thread for reasonable performance.
Sourcepub fn dev_fast() -> Self
pub fn dev_fast() -> Self
Fast configuration for development and testing.
Uses minimal resources: 1 MiB memory, 1 iteration, and 1 thread.
Sourcepub fn with_memory_kib(self, v: u32) -> Self
pub fn with_memory_kib(self, v: u32) -> Self
Override the memory usage in KiB.
Sourcepub fn with_time_cost(self, v: u32) -> Self
pub fn with_time_cost(self, v: u32) -> Self
Override the time cost (number of iterations).
Sourcepub fn with_parallelism(self, v: u32) -> Self
pub fn with_parallelism(self, v: u32) -> Self
Override the number of parallel threads.
Trait Implementations§
Source§impl Clone for Argon2Config
impl Clone for Argon2Config
Source§fn clone(&self) -> Argon2Config
fn clone(&self) -> Argon2Config
Returns a duplicate 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 Argon2Config
impl Debug for Argon2Config
Source§impl Default for Argon2Config
impl Default for Argon2Config
impl Copy for Argon2Config
Auto Trait Implementations§
impl Freeze for Argon2Config
impl RefUnwindSafe for Argon2Config
impl Send for Argon2Config
impl Sync for Argon2Config
impl Unpin for Argon2Config
impl UnwindSafe for Argon2Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more