pub struct Select { /* private fields */ }Expand description
A question that a user answers with one of several options
The options are the texts that the user sees, in the order of display. The answer is the position of one option, and the first option has the position zero.
Prompt::select builds this type from the Display text of its options and sends it to
the presenter. A command does not usually build it.
§Examples
use clawless_core::prompt::Select;
let question = Select::new("Kind of change", ["Added", "Changed", "Fixed"]);
assert_eq!(question.options().len(), 3);Implementations§
Trait Implementations§
impl Eq for Select
impl StructuralPartialEq for Select
Auto Trait Implementations§
impl Freeze for Select
impl RefUnwindSafe for Select
impl Send for Select
impl Sync for Select
impl Unpin for Select
impl UnsafeUnpin for Select
impl UnwindSafe for Select
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