Struct dialoguer::Select
[−]
[src]
pub struct Select { /* fields omitted */ }
Renders a selection menu.
Methods
impl Select
[src]
fn new() -> Select
Creates the prompt with a specific text.
fn clear(&mut self, val: bool) -> &mut Select
Sets the clear behavior of the menu.
The default is to clear the menu.
fn default(&mut self, val: usize) -> &mut Select
Sets a default for the menu
fn item(&mut self, item: &str) -> &mut Select
Add a single item to the selector.
fn items(&mut self, items: &[&str]) -> &mut Select
Adds multiple items to the selector.
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.
fn interact_on(&self, term: &Term) -> Result<usize>
Like interact
but allows a specific terminal to be set.