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 spaces: bool,
pub exclude_similar_characters: bool,
pub strict: bool,
}
Expand description
This struct can help you generate passwords.
Fields
length: usize
The length of the generated passwords.
Default: 8
numbers: bool
Passwords are allowed to, or must if the strict is true, contain a number or numbers.
Default: true
lowercase_letters: bool
Passwords are allowed to, or must if the strict is true, contain a lowercase letter or lowercase letters.
Default: true
uppercase_letters: bool
Passwords are allowed to, or must if the strict is true, contain an uppercase letter or uppercase letters.
Default: false
symbols: bool
Passwords are allowed to, or must if the strict is true, contain a symbol or symbols.
Default: false
spaces: bool
Passwords are allowed to, or must if the strict is true, contain a space or spaces.
Default: false
exclude_similar_characters: bool
Whether to exclude similar characters, iI1loO0"'`|
.
Default: false
strict: bool
Whether the password rules are strict.
Default: false
Implementations
Create a PasswordGenerator
instance.
PasswordGenerator {
length: 8,
numbers: true,
lowercase_letters: true,
uppercase_letters: false,
symbols: false,
spaces: false,
exclude_similar_characters: false,
strict: false,
}
The length of the generated passwords.
Passwords are allowed to, or must if the strict is true, contain a number or numbers.
Passwords are allowed to, or must if the strict is true, contain a lowercase letter or lowercase letters.
Passwords are allowed to, or must if the strict is true, contain an uppercase letter or uppercase letters.
Passwords are allowed to, or must if the strict is true, contain a symbol or symbols.
Passwords are allowed to, or must if the strict is true, contain a space or spaces.
pub const fn exclude_similar_characters(
self,
exclude_similar_characters: bool
) -> PasswordGenerator
pub const fn exclude_similar_characters(
self,
exclude_similar_characters: bool
) -> PasswordGenerator
Whether to exclude similar characters? The excluded similar characters set is iI1loO0"'`|
.
Whether the password rules are strict.
Generate random passwords.
Generate a random password.
Trait Implementations
Returns the “default value” for a type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for PasswordGenerator
impl Send for PasswordGenerator
impl Sync for PasswordGenerator
impl Unpin for PasswordGenerator
impl UnwindSafe for PasswordGenerator
Blanket Implementations
Mutably borrows from an owned value. Read more