pub struct Confirm {
pub title: String,
pub theme: Theme,
pub description: String,
pub affirmative: String,
pub negative: String,
pub selected: bool,
/* private fields */
}Expand description
Select multiple options from a list
Example
use demand::Confirm;
let ms = Confirm::new("Are you sure?")
.affirmative("Yes!")
.negative("No.");
let yes = ms.run().expect("error running confirm");
println!("yes: {}", yes);Fields§
§title: StringThe title of the selector
theme: ThemeThe colors/style of the selector
description: StringA description to display above the selector
affirmative: StringThe text to display for the affirmative option
negative: StringThe text to display for the negative option
selected: boolIf true, the affirmative option is selected by default
Implementations§
source§impl Confirm
impl Confirm
sourcepub fn description(self, description: &str) -> Self
pub fn description(self, description: &str) -> Self
Set the description of the selector
sourcepub fn affirmative<S: Into<String>>(self, affirmative: S) -> Self
pub fn affirmative<S: Into<String>>(self, affirmative: S) -> Self
Set the label of the affirmative option
sourcepub fn negative<S: Into<String>>(self, negative: S) -> Self
pub fn negative<S: Into<String>>(self, negative: S) -> Self
Set the label of the negative option
Auto Trait Implementations§
impl RefUnwindSafe for Confirm
impl Send for Confirm
impl Sync for Confirm
impl Unpin for Confirm
impl UnwindSafe for Confirm
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more