pub struct Select<'a> { /* private fields */ }
Expand description
Renders a selection menu.
Implementations
sourceimpl<'a> Select<'a>
impl<'a> Select<'a>
sourcepub fn with_theme(theme: &'a dyn Theme) -> Select<'a>
pub fn with_theme(theme: &'a dyn Theme) -> Select<'a>
Same as new
but with a specific theme.
sourcepub fn clear(&mut self, val: bool) -> &mut Select<'a>
pub fn clear(&mut self, val: bool) -> &mut Select<'a>
Sets the clear behavior of the menu.
The default is to clear the menu.
sourcepub fn items<T: ToString>(&mut self, items: &[T]) -> &mut Select<'a>
pub fn items<T: ToString>(&mut self, items: &[T]) -> &mut Select<'a>
Adds multiple items to the selector.
sourcepub fn with_prompt(&mut self, prompt: &str) -> &mut Select<'a>
pub fn with_prompt(&mut self, prompt: &str) -> &mut Select<'a>
Prefaces the menu with a prompt.
When a prompt is set the system also prints out a confirmation after the selection.
sourcepub fn interact(&self) -> Result<usize>
pub fn interact(&self) -> Result<usize>
Enables user interaction and returns the result.
If the user confirms the result is true
, false
otherwise.
The dialog is rendered on stderr.
sourcepub fn interact_on(&self, term: &Term) -> Result<usize>
pub fn interact_on(&self, term: &Term) -> Result<usize>
Like interact
but allows a specific terminal to be set.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Select<'a>
impl<'a> !Send for Select<'a>
impl<'a> !Sync for Select<'a>
impl<'a> Unpin for Select<'a>
impl<'a> !UnwindSafe for Select<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more