pub struct WorkFactor(/* private fields */);
Expand description
A bcrypt work factor.
Implementations§
Source§impl WorkFactor
impl WorkFactor
pub const EXP4: Self
pub const EXP5: Self
pub const EXP6: Self
pub const EXP7: Self
pub const EXP8: Self
pub const EXP9: Self
pub const EXP10: Self
pub const EXP11: Self
pub const EXP12: Self
pub const EXP13: Self
pub const EXP14: Self
pub const EXP15: Self
pub const EXP16: Self
pub const EXP17: Self
pub const EXP18: Self
pub const EXP19: Self
pub const EXP20: Self
pub const EXP21: Self
pub const EXP22: Self
pub const EXP23: Self
pub const EXP24: Self
pub const EXP25: Self
pub const EXP26: Self
pub const EXP27: Self
pub const EXP28: Self
pub const EXP29: Self
pub const EXP30: Self
pub const EXP31: Self
Sourcepub fn exp(log_rounds: u32) -> Option<Self>
pub fn exp(log_rounds: u32) -> Option<Self>
Creates a bcrypt work factor from a typical base-2 exponent between 4 and 31 (inclusive). The number of rounds is 2**log_rounds
.
Sourcepub const fn log_rounds(self) -> u32
pub const fn log_rounds(self) -> u32
The base-2 logarithm of the number of rounds represented by this work factor.
Sourcepub const fn linear_rounds(self) -> u32
pub const fn linear_rounds(self) -> u32
The number of rounds represented by this work factor.
Trait Implementations§
Source§impl Clone for WorkFactor
impl Clone for WorkFactor
Source§fn clone(&self) -> WorkFactor
fn clone(&self) -> WorkFactor
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 WorkFactor
impl Debug for WorkFactor
Source§impl Hash for WorkFactor
impl Hash for WorkFactor
Source§impl Ord for WorkFactor
impl Ord for WorkFactor
Source§fn cmp(&self, other: &WorkFactor) -> Ordering
fn cmp(&self, other: &WorkFactor) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for WorkFactor
impl PartialEq for WorkFactor
Source§impl PartialOrd for WorkFactor
impl PartialOrd for WorkFactor
impl Copy for WorkFactor
impl Eq for WorkFactor
impl StructuralPartialEq for WorkFactor
Auto Trait Implementations§
impl Freeze for WorkFactor
impl RefUnwindSafe for WorkFactor
impl Send for WorkFactor
impl Sync for WorkFactor
impl Unpin for WorkFactor
impl UnwindSafe for WorkFactor
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