Struct inquire::Password [−][src]
pub struct Password<'a> { pub message: &'a str, pub help_message: Option<&'a str>, pub formatter: fn(answer: &str) -> &str, pub validators: Vec<StringValidator<'a>>, }
Expand description
Presents a message to the user and retrieves a single line of text input.
Password differs from [Text] by not echoing the user input and having a smaller set of custom behaviors in comparison.
By default, the response is always formatted as “********”.
Fields
message: &'a str
Message to be presented to the user.
help_message: Option<&'a str>
Help message to be presented to the user.
formatter: fn(answer: &str) -> &str
Function that formats the user input and presents it to the user as the final rendering of the prompt.
validators: Vec<StringValidator<'a>>
Collection of validators to apply to the user input. Validation errors are displayed to the user one line above the prompt.
Implementations
Default formatter.
Default collection of validators.
Default help message.
Creates a Password with the provided message and default options.
Sets the help message of the prompt.
Sets the formatter
Adds a validator to the collection of validators.
Adds the validators to the collection of validators.
Parses the provided behavioral and rendering options and prompts the CLI user for input according to them.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Password<'a>
impl<'a> !UnwindSafe for Password<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more