pub struct Combobox<T: Searchable + Send + Sync + 'static> { /* private fields */ }Implementations§
Source§impl<T: Searchable + Send + Sync + 'static> Combobox<T>
impl<T: Searchable + Send + Sync + 'static> Combobox<T>
pub fn new(items: Vec<T>) -> Self
pub fn from_matches(matches: Vec<T>) -> Self
pub fn query(&self) -> &str
pub fn matches(&self) -> &[T]
pub fn selected_index(&self) -> usize
pub fn set_max_visible(&mut self, max: usize)
pub fn set_match_sort(&mut self, sort: fn(&T, &T) -> Ordering)
pub fn is_empty(&self) -> bool
pub fn selected(&self) -> Option<&T>
pub fn push_query_char(&mut self, c: char)
pub fn pop_query_char(&mut self)
pub fn set_selected_index(&mut self, index: usize)
pub fn move_up(&mut self)
pub fn move_down(&mut self)
pub fn move_up_where(&mut self, predicate: impl Fn(&T) -> bool)
pub fn move_down_where(&mut self, predicate: impl Fn(&T) -> bool)
pub fn select_first_where(&mut self, predicate: impl Fn(&T) -> bool)
pub fn render_items( &self, context: &ViewContext, render_item: impl Fn(&T, bool, &ViewContext) -> Line, ) -> Vec<Line>
pub fn visible_matches_with_selection(&self) -> Vec<(&T, bool)>
Sourcepub fn handle_picker_event(
&mut self,
event: &Event,
) -> Option<Vec<PickerMessage<T>>>
pub fn handle_picker_event( &mut self, event: &Event, ) -> Option<Vec<PickerMessage<T>>>
Standard event dispatch for picker-style components.
Handles Escape, Up/Down, Enter (confirm), Char (query + whitespace-close),
Backspace, and BackspaceOnEmpty. Returns PickerMessage<T> for each action.
Auto Trait Implementations§
impl<T> Freeze for Combobox<T>
impl<T> !RefUnwindSafe for Combobox<T>
impl<T> Send for Combobox<T>
impl<T> Sync for Combobox<T>
impl<T> Unpin for Combobox<T>where
T: Unpin,
impl<T> UnsafeUnpin for Combobox<T>
impl<T> !UnwindSafe for Combobox<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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more