pub struct PickerState { /* private fields */ }Expand description
State for the fuzzy picker
Implementations§
Source§impl PickerState
impl PickerState
Sourcepub fn new(items: Vec<PickerItem>) -> Self
pub fn new(items: Vec<PickerItem>) -> Self
Create a new picker with the given items
Sourcepub fn with_visible_height(self, height: usize) -> Self
pub fn with_visible_height(self, height: usize) -> Self
Set the visible height
Sourcepub fn selected(&self) -> Option<&PickerItem>
pub fn selected(&self) -> Option<&PickerItem>
Get the currently selected item, if any
Sourcepub fn visible_items(&self) -> impl Iterator<Item = VisibleItem<'_>>
pub fn visible_items(&self) -> impl Iterator<Item = VisibleItem<'_>>
Get visible items with their display info
Sourcepub fn has_more_above(&self) -> bool
pub fn has_more_above(&self) -> bool
Check if there are more items above the visible area
Sourcepub fn has_more_below(&self) -> bool
pub fn has_more_below(&self) -> bool
Check if there are more items below the visible area
Sourcepub fn filtered_count(&self) -> usize
pub fn filtered_count(&self) -> usize
Get the total number of filtered items
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Get the total number of items
Sourcepub fn clear_filter(&mut self)
pub fn clear_filter(&mut self)
Clear the filter
Trait Implementations§
Source§impl Clone for PickerState
impl Clone for PickerState
Auto Trait Implementations§
impl !Freeze for PickerState
impl RefUnwindSafe for PickerState
impl Send for PickerState
impl Sync for PickerState
impl Unpin for PickerState
impl UnsafeUnpin for PickerState
impl UnwindSafe for PickerState
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