Struct dialog::Question

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

A question dialog box.

This dialog box displays a text and an optional title and has a yes and a no button. The output is the button presed by the user, or Cancel if the dialog has been cancelled.

Example

use dialog::DialogBox;

let choice = dialog::Question::new("Do you want to continue?")
    .title("Question")
    .show()
    .expect("Could not display dialog box");
println!("The user chose: {:?}", choice);

Implementations

Creates a new question dialog with the given text.

Sets the title of this question 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.