Struct stdcli::term::Input [] [src]

pub struct Input { /* fields omitted */ }

Renders a simple input prompt.

Example usage

use dialoguer::Input;

let name = Input::new("Your name").interact()?;
println!("Name: {}", name);

Methods

impl Input
[src]

[src]

Creates a new input prompt.

[src]

Sets the clear behavior of the prompt.

The default is not to clear.

[src]

Sets a default.

Out of the box the prompt does not have a default and will continue to display until the user hit enter. If a default is set the user can instead accept the default with enter.

[src]

Disables or enables the default value display.

The default is to append [default] to the prompt to tell the user that a default is acceptable.

[src]

Enables user interaction and returns the result.

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

[src]

Like interact but allows a specific terminal to be set.