pub struct Confirm<'a> {
pub title: String,
pub theme: &'a 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 confirm = Confirm::new("Are you sure?")
.affirmative("Yes!")
.negative("No.");
let yes = confirm.run().expect("error running confirm");Fields§
§title: StringThe title of the selector
theme: &'a 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<'a> Confirm<'a>
impl<'a> Confirm<'a>
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<'a> Freeze for Confirm<'a>
impl<'a> RefUnwindSafe for Confirm<'a>
impl<'a> Send for Confirm<'a>
impl<'a> Sync for Confirm<'a>
impl<'a> Unpin for Confirm<'a>
impl<'a> UnwindSafe for Confirm<'a>
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