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.

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.

Try to create an iterator for the purpose of reusing.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.