pub struct PickerData<M = ()> {
pub title: Option<String>,
pub input: TextInputState<PickerInputProvider>,
pub query_placeholder: String,
pub source_entries: Vec<PickerEntry>,
pub filtered_indices: Vec<usize>,
pub selected_filtered_index: Option<usize>,
pub empty_preview: String,
pub scopes: Vec<PickerScope>,
pub layout: PickerLayout,
pub head: Option<PickerHead>,
/* private fields */
}Expand description
A generic, scope-aware fuzzy picker.
M is an application-owned mode payload stored opaquely (see
set_mode); the library never inspects it. Use
PickerData<()> (the default) when you don’t need one.
Fields§
§title: Option<String>§input: TextInputState<PickerInputProvider>§query_placeholder: String§source_entries: Vec<PickerEntry>§filtered_indices: Vec<usize>§selected_filtered_index: Option<usize>§empty_preview: String§scopes: Vec<PickerScope>§layout: PickerLayout§head: Option<PickerHead>Implementations§
Source§impl<M> PickerData<M>
impl<M> PickerData<M>
pub fn new() -> Self
pub fn with_entries(entries: Vec<PickerEntry>) -> Self
pub fn with_layout(self, layout: PickerLayout) -> Self
pub fn single_pane(self) -> Self
pub fn set_layout(&mut self, layout: PickerLayout)
pub fn with_head(self, head: PickerHead) -> Self
pub fn set_head(&mut self, head: PickerHead)
pub fn clear_head(&mut self)
pub fn with_field_weights(self, weights: PickerFieldWeights) -> Self
pub fn set_field_weights(&mut self, weights: PickerFieldWeights)
pub fn field_weights(&self) -> &PickerFieldWeights
pub fn with_mode(self, mode: M) -> Self
pub fn clear_mode(&mut self)
pub fn take_mode(&mut self) -> Option<M>
pub fn mode_ref(&self) -> Option<&M>
pub fn mode_mut(&mut self) -> Option<&mut M>
pub fn set_entries(&mut self, entries: Vec<PickerEntry>)
pub fn set_scopes(&mut self, scopes: Vec<PickerScope>)
pub fn set_suggestion_scopes(&mut self, scopes: Option<Vec<PickerScope>>)
pub fn clear_suggestion_scopes(&mut self)
pub fn set_implicit_scope(&mut self, token: &str, value: &str)
pub fn set_selected_source_index(&mut self, source_index: Option<usize>)
pub fn push_char(&mut self, ch: char)
pub fn pop_char(&mut self)
pub fn clear_input(&mut self)
pub fn input_ref(&self) -> &TextInputState<PickerInputProvider>
pub fn input_mut(&mut self) -> &mut TextInputState<PickerInputProvider>
pub fn refresh_filter(&mut self)
pub fn move_up(&mut self)
pub fn move_down(&mut self)
pub fn filtered_len(&self) -> usize
pub fn visible_entries(&self) -> impl Iterator<Item = (usize, &PickerEntry)>
pub fn selected_entry(&self) -> Option<&PickerEntry>
pub fn count_label(&self) -> String
pub fn scope_hint(&self) -> String
pub fn active_scope_label(&self) -> Option<String>
pub fn paste(&mut self, text: &str) -> TextInputEventOutcome
pub fn autocomplete_selected(&mut self) -> TextInputEventOutcome
Trait Implementations§
Source§impl<M: Clone> Clone for PickerData<M>
impl<M: Clone> Clone for PickerData<M>
Source§impl<M: Debug> Debug for PickerData<M>
impl<M: Debug> Debug for PickerData<M>
Source§impl<M> Default for PickerData<M>
impl<M> Default for PickerData<M>
impl<M: Eq> Eq for PickerData<M>
Source§impl<M: PartialEq> PartialEq for PickerData<M>
impl<M: PartialEq> PartialEq for PickerData<M>
Auto Trait Implementations§
impl<M = ()> !RefUnwindSafe for PickerData<M>
impl<M = ()> !UnwindSafe for PickerData<M>
impl<M> Freeze for PickerData<M>where
M: Freeze,
impl<M> Send for PickerData<M>where
M: Send,
impl<M> Sync for PickerData<M>where
M: Sync,
impl<M> Unpin for PickerData<M>where
M: Unpin,
impl<M> UnsafeUnpin for PickerData<M>where
M: UnsafeUnpin,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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