pub enum AccessibleInput {
Text(String),
Selection(usize),
MultiSelection(Vec<usize>),
Yes,
No,
Cancel,
Empty,
}Expand description
Result of parsing accessible input.
Variants§
Text(String)
Text input.
Selection(usize)
Numeric selection (1-based).
MultiSelection(Vec<usize>)
Multiple selections (1-based).
Yes
Yes/true response.
No
No/false response.
Cancel
Cancel/quit.
Empty
Empty input (use default).
Implementations§
Source§impl AccessibleInput
impl AccessibleInput
Sourcepub fn parse_text(input: &str) -> Self
pub fn parse_text(input: &str) -> Self
Parse input for a text prompt.
Sourcepub fn parse_selection(input: &str, max: usize) -> Self
pub fn parse_selection(input: &str, max: usize) -> Self
Parse input for a selection prompt (1-based number).
Sourcepub fn parse_multi_selection(input: &str, max: usize) -> Self
pub fn parse_multi_selection(input: &str, max: usize) -> Self
Parse input for a multi-selection prompt (comma-separated 1-based numbers).
Sourcepub fn parse_confirm(input: &str, default: Option<bool>) -> Self
pub fn parse_confirm(input: &str, default: Option<bool>) -> Self
Parse input for a yes/no prompt.
Trait Implementations§
Source§impl Clone for AccessibleInput
impl Clone for AccessibleInput
Source§fn clone(&self) -> AccessibleInput
fn clone(&self) -> AccessibleInput
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AccessibleInput
impl RefUnwindSafe for AccessibleInput
impl Send for AccessibleInput
impl Sync for AccessibleInput
impl Unpin for AccessibleInput
impl UnwindSafe for AccessibleInput
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