Struct dialog::Input

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

A dialog box with a text input field.

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

Example

use dialog::DialogBox;

let name = dialog::Input::new("Please enter your name")
    .title("Name")
    .show()
    .expect("Could not display dialog box");
match name {
    Some(name) => println!("Hello {}!", name),
    None => println!("Hello stranger!"),
};

Implementations

Creates a new input dialog box with the given text.

Sets the title of this input box.

This method returns a reference to self to enable chaining.

Sets the default value of this input 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.