Struct tty_form::SelectInput
source · [−]pub struct SelectInput { /* private fields */ }Expand description
An option selection field.
Examples
use tty_form::Form;
let mut form = Form::default();
let mut input = form.add_compound_step().add_text_input();
input.set_force_lowercase(true);Implementations
sourceimpl SelectInput
impl SelectInput
pub fn new(prompt: &str, options: Vec<(&str, &str)>) -> Self
sourcepub fn set_prompt(&mut self, prompt: &str)
pub fn set_prompt(&mut self, prompt: &str)
Update this input’s prompt text.
sourcepub fn add_option(&mut self, option: SelectInputOption)
pub fn add_option(&mut self, option: SelectInputOption)
Add an option to this input’s list.
sourcepub fn set_options(&mut self, options: Vec<SelectInputOption>)
pub fn set_options(&mut self, options: Vec<SelectInputOption>)
Set this input’s options.
Trait Implementations
sourceimpl Control for SelectInput
impl Control for SelectInput
fn is_focusable(&self) -> bool
fn handle_input(&mut self, key_event: KeyEvent)
fn get_help(&self) -> Option<String>
fn get_text(&self) -> (String, Option<u16>)
fn get_drawer(&self) -> Option<Vec<String>>
fn add_to_step(self, step: &mut CompoundStep)
Auto Trait Implementations
impl RefUnwindSafe for SelectInput
impl Send for SelectInput
impl Sync for SelectInput
impl Unpin for SelectInput
impl UnwindSafe for SelectInput
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