pub struct WorkFactor(/* private fields */);
Expand description
A bcrypt work factor.
Implementations§
Source§impl WorkFactor
impl WorkFactor
pub const EXP4: WorkFactor
pub const EXP5: WorkFactor
pub const EXP6: WorkFactor
pub const EXP7: WorkFactor
pub const EXP8: WorkFactor
pub const EXP9: WorkFactor
pub const EXP10: WorkFactor
pub const EXP11: WorkFactor
pub const EXP12: WorkFactor
pub const EXP13: WorkFactor
pub const EXP14: WorkFactor
pub const EXP15: WorkFactor
pub const EXP16: WorkFactor
pub const EXP17: WorkFactor
pub const EXP18: WorkFactor
pub const EXP19: WorkFactor
pub const EXP20: WorkFactor
pub const EXP21: WorkFactor
pub const EXP22: WorkFactor
pub const EXP23: WorkFactor
pub const EXP24: WorkFactor
pub const EXP25: WorkFactor
pub const EXP26: WorkFactor
pub const EXP27: WorkFactor
pub const EXP28: WorkFactor
pub const EXP29: WorkFactor
pub const EXP30: WorkFactor
pub const EXP31: WorkFactor
Sourcepub fn exp(log_rounds: u32) -> Option<WorkFactor>
pub fn exp(log_rounds: u32) -> Option<WorkFactor>
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