pub struct MultiSelect<T: Clone + PartialEq + Send + Sync + 'static> { /* private fields */ }Expand description
A multi-select field for choosing multiple options from a list.
Implementations§
Source§impl<T: Clone + PartialEq + Send + Sync + Default + 'static> MultiSelect<T>
impl<T: Clone + PartialEq + Send + Sync + Default + 'static> MultiSelect<T>
Sourcepub fn options(self, options: Vec<SelectOption<T>>) -> Self
pub fn options(self, options: Vec<SelectOption<T>>) -> Self
Sets the options.
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Sets the description.
Sourcepub fn validate(self, validate: fn(&[T]) -> Option<String>) -> Self
pub fn validate(self, validate: fn(&[T]) -> Option<String>) -> Self
Sets the validation function.
Sourcepub fn height_options(self, height: usize) -> Self
pub fn height_options(self, height: usize) -> Self
Sets the visible height (number of options shown).
Sourcepub fn filterable(self, enabled: bool) -> Self
pub fn filterable(self, enabled: bool) -> Self
Enables or disables filtering mode.
When enabled, pressing ‘/’ enters filter mode where typing filters options.
Sourcepub fn get_selected_values(&self) -> Vec<&T>
pub fn get_selected_values(&self) -> Vec<&T>
Gets the currently selected values.
Trait Implementations§
Source§impl<T: Clone + PartialEq + Send + Sync + Default + 'static> Field for MultiSelect<T>
impl<T: Clone + PartialEq + Send + Sync + Default + 'static> Field for MultiSelect<T>
Source§fn with_theme(&mut self, theme: &Theme)
fn with_theme(&mut self, theme: &Theme)
Sets the theme.
Source§fn with_keymap(&mut self, keymap: &KeyMap)
fn with_keymap(&mut self, keymap: &KeyMap)
Sets the keymap.
Source§fn with_width(&mut self, width: usize)
fn with_width(&mut self, width: usize)
Sets the width.
Source§fn with_height(&mut self, height: usize)
fn with_height(&mut self, height: usize)
Sets the height.
Source§fn with_position(&mut self, position: FieldPosition)
fn with_position(&mut self, position: FieldPosition)
Sets the field position.
Auto Trait Implementations§
impl<T> Freeze for MultiSelect<T>
impl<T> !RefUnwindSafe for MultiSelect<T>
impl<T> Send for MultiSelect<T>
impl<T> Sync for MultiSelect<T>
impl<T> Unpin for MultiSelect<T>where
T: Unpin,
impl<T> !UnwindSafe for MultiSelect<T>
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