pub struct Password<'a> { /* private fields */ }
Expand description

Renders a password input prompt.

Example usage

use dialoguer::Password;

let password = Password::new().with_prompt("New Password")
    .with_confirmation("Confirm password", "Passwords mismatching")
    .interact()?;
println!("Length of the password is: {}", password.len());

Implementations

Creates a password input prompt.

Sets the password input prompt.

Indicates whether to report confirmation after interaction.

The default is to report.

Enables confirmation prompting.

Allows/Disables empty password.

By default this setting is set to false (i.e. password is not empty).

Enables user interaction and returns the result.

If the user confirms the result is true, false otherwise. The dialog is rendered on stderr.

Like interact but allows a specific terminal to be set.

Creates a password input prompt with a specific theme.

Trait Implementations

Returns the “default value” for a type. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.