Struct dialog::Password

source ·
pub struct Password { /* private fields */ }
Expand description

A dialog box with a password input field.

This dialog box displays a text and a password input field. It returns the password entered by the user or None if the user cancelled the dialog.

Example

use dialog::DialogBox;

let password = dialog::Password::new("Please enter a new password")
    .title("Password")
    .show()
    .expect("Could not display dialog box");
match password {
    Some(password) => println!("Your new password is: {}", password),
    None => println!("You do not want to have a password."),
};

Implementations

Creates a new password dialog box with the given text.

Sets the title of this password dialog box.

This method returns a reference to self to enable chaining.

Trait Implementations

The type of the data returned by the dialog box.
Shows this dialog box using the given backend and returns the output.
Shows this dialog box using the default backend and returns the output. 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.