pub struct PasswordGenerator { /* private fields */ }
Expand description
PasswordGenerator is responsible for generating a memorizable password.
§Example
let pwd = PasswordGenerator::default();
println!("{}", pwd.generate())
Implementations§
Source§impl PasswordGenerator
impl PasswordGenerator
Sourcepub fn new(length: usize) -> Self
pub fn new(length: usize) -> Self
Create a new PasswordGenerator
that generates length
number of words.
Sourcepub fn with_list(&self, list: &[&str]) -> Self
pub fn with_list(&self, list: &[&str]) -> Self
Change the list that is used to generate passwords to your own.
§Example
let pwd = PasswordGenerator::default().with_list(&["foo", "bar"]);
println!("{}", pwd.generate());
pub fn generate(&self) -> String
Trait Implementations§
Source§impl Clone for PasswordGenerator
impl Clone for PasswordGenerator
Source§fn clone(&self) -> PasswordGenerator
fn clone(&self) -> PasswordGenerator
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 PasswordGenerator
impl Debug for PasswordGenerator
Source§impl Default for PasswordGenerator
impl Default for PasswordGenerator
Source§impl PartialEq for PasswordGenerator
impl PartialEq for PasswordGenerator
impl Eq for PasswordGenerator
impl StructuralPartialEq for PasswordGenerator
Auto Trait Implementations§
impl Freeze for PasswordGenerator
impl RefUnwindSafe for PasswordGenerator
impl Send for PasswordGenerator
impl Sync for PasswordGenerator
impl Unpin for PasswordGenerator
impl UnwindSafe for PasswordGenerator
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