Struct passwords::PasswordGenerator [−][src]
pub struct PasswordGenerator { pub length: usize, pub numbers: bool, pub lowercase_letters: bool, pub uppercase_letters: bool, pub symbols: bool, pub strict: bool, }
This struct can help you generate passwords.
Fields
length: usize
The length of the generated passwords.
numbers: bool
Passwords are allowed to, or must if the strict is true, contain a number or numbers.
Numbers are 123456789
. (0 is excluded)
lowercase_letters: bool
Passwords are allowed to, or must if the strict is true, contain a lowercase letter or lowercase letters.
Lowercase letters are abcdefghjkmnpqrstuvwxyz
. (i, l, o are excluded)
uppercase_letters: bool
Passwords are allowed to, or must if the strict is true, contain an uppercase letter or uppercase letters.
Uppercase letters are ABCDEFGHJKMNPQRSTUVWXYZ
. (I, L, O are excluded)
symbols: bool
Passwords are allowed to, or must if the strict is true, contain a symbol or symbols.
Symbols are !@#$%^&*()+_-=}{[]:;"/?.><,~
.
strict: bool
Whether the password rules are strict.
Methods
impl PasswordGenerator
[src]
impl PasswordGenerator
pub fn generate(&self, count: usize) -> Result<Vec<String>, &'static str>
[src]
pub fn generate(&self, count: usize) -> Result<Vec<String>, &'static str>
Generate random passwords.
pub fn generate_one(&self) -> Result<String, &'static str>
[src]
pub fn generate_one(&self) -> Result<String, &'static str>
Generate a random password.
Trait Implementations
impl Debug for PasswordGenerator
[src]
impl Debug for PasswordGenerator
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for PasswordGenerator
[src]
impl Clone for PasswordGenerator
fn clone(&self) -> PasswordGenerator
[src]
fn clone(&self) -> PasswordGenerator
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for PasswordGenerator
[src]
impl PartialEq for PasswordGenerator
fn eq(&self, other: &PasswordGenerator) -> bool
[src]
fn eq(&self, other: &PasswordGenerator) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &PasswordGenerator) -> bool
[src]
fn ne(&self, other: &PasswordGenerator) -> bool
This method tests for !=
.
Auto Trait Implementations
impl Send for PasswordGenerator
impl Send for PasswordGenerator
impl Sync for PasswordGenerator
impl Sync for PasswordGenerator