pub struct SearchableVec<T> { /* private fields */ }Expand description
A vector of items that supports incremental filtering.
On each perform_search call the matched_items view is rebuilt by filtering
the full items list. Use this as a delegate when all data is already in memory.
Implementations§
Trait Implementations§
Source§impl<T: Clone> Clone for SearchableVec<T>
impl<T: Clone> Clone for SearchableVec<T>
Source§fn clone(&self) -> SearchableVec<T>
fn clone(&self) -> SearchableVec<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for SearchableVec<T>
impl<T: Debug> Debug for SearchableVec<T>
Source§impl<T: SearchableListItem> From<Vec<T>> for SearchableVec<T>
impl<T: SearchableListItem> From<Vec<T>> for SearchableVec<T>
Source§impl<I: SearchableListItem + 'static> SearchableListDelegate for SearchableVec<I>
impl<I: SearchableListItem + 'static> SearchableListDelegate for SearchableVec<I>
type Item = I
Source§fn items_count(&self, _: usize) -> usize
fn items_count(&self, _: usize) -> usize
Number of items in the given section.
Source§fn item(&self, ix: IndexPath) -> Option<&Self::Item>
fn item(&self, ix: IndexPath) -> Option<&Self::Item>
Return a reference to the item at the given index path.
Source§fn position<V>(&self, value: &V) -> Option<IndexPath>
fn position<V>(&self, value: &V) -> Option<IndexPath>
Find the index path of the item whose value equals
value.Source§fn perform_search(
&mut self,
query: &str,
_: &mut Window,
_: &mut App,
) -> Task<()> ⓘ
fn perform_search( &mut self, query: &str, _: &mut Window, _: &mut App, ) -> Task<()> ⓘ
Called when the search query changes. Read more
Source§fn sections_count(&self, _: &App) -> usize
fn sections_count(&self, _: &App) -> usize
Number of sections (groups) in the list. Defaults to 1.
Source§fn section(&self, _section: usize) -> Option<AnyElement>
fn section(&self, _section: usize) -> Option<AnyElement>
👎Deprecated
Optional header element for the given section index. Read more
Source§fn render_item(
&self,
_ix: IndexPath,
_item: &Self::Item,
_checked: bool,
_window: &mut Window,
_cx: &mut App,
) -> Option<AnyElement>
fn render_item( &self, _ix: IndexPath, _item: &Self::Item, _checked: bool, _window: &mut Window, _cx: &mut App, ) -> Option<AnyElement>
Override the row content for the item at
ix. Read moreSource§fn render_section_header(
&self,
_section: usize,
_window: &mut Window,
_cx: &mut App,
) -> Option<AnyElement>
fn render_section_header( &self, _section: usize, _window: &mut Window, _cx: &mut App, ) -> Option<AnyElement>
Render the header element for the given section (full render access). Read more
Source§fn is_item_enabled(&self, _ix: IndexPath, item: &Self::Item, _cx: &App) -> bool
fn is_item_enabled(&self, _ix: IndexPath, item: &Self::Item, _cx: &App) -> bool
Whether the item at
ix should be rendered as interactive. Read moreSource§fn is_item_checked(
&self,
_ix: IndexPath,
item: &Self::Item,
current_selection: &[(IndexPath, Self::Item)],
_cx: &App,
) -> bool
fn is_item_checked( &self, _ix: IndexPath, item: &Self::Item, current_selection: &[(IndexPath, Self::Item)], _cx: &App, ) -> bool
Whether the item at
ix should show a checkmark. Read moreSource§fn on_will_change(
&mut self,
selection: &mut Vec<(IndexPath, Self::Item)>,
changes: &[SearchableListChange],
)
fn on_will_change( &mut self, selection: &mut Vec<(IndexPath, Self::Item)>, changes: &[SearchableListChange], )
Called before a user-triggered selection change is committed. Read more
Source§fn on_confirm(&mut self, _final_selection: &[(IndexPath, Self::Item)])
fn on_confirm(&mut self, _final_selection: &[(IndexPath, Self::Item)])
Called when the dropdown/popover is committed (Escape,
close_on_select, or explicit
confirm). final_selection is the selection after the last committed change.Source§impl<I: SearchableListItem + 'static> SearchableListDelegate for SearchableVec<SearchableGroup<I>>
impl<I: SearchableListItem + 'static> SearchableListDelegate for SearchableVec<SearchableGroup<I>>
type Item = I
Source§fn sections_count(&self, _: &App) -> usize
fn sections_count(&self, _: &App) -> usize
Number of sections (groups) in the list. Defaults to 1.
Source§fn items_count(&self, section: usize) -> usize
fn items_count(&self, section: usize) -> usize
Number of items in the given section.
Source§fn section(&self, section: usize) -> Option<AnyElement>
fn section(&self, section: usize) -> Option<AnyElement>
👎Deprecated
Optional header element for the given section index. Read more
Source§fn item(&self, ix: IndexPath) -> Option<&Self::Item>
fn item(&self, ix: IndexPath) -> Option<&Self::Item>
Return a reference to the item at the given index path.
Source§fn position<V>(&self, value: &V) -> Option<IndexPath>
fn position<V>(&self, value: &V) -> Option<IndexPath>
Find the index path of the item whose value equals
value.Source§fn perform_search(
&mut self,
query: &str,
_: &mut Window,
_: &mut App,
) -> Task<()> ⓘ
fn perform_search( &mut self, query: &str, _: &mut Window, _: &mut App, ) -> Task<()> ⓘ
Called when the search query changes. Read more
Source§fn render_item(
&self,
_ix: IndexPath,
_item: &Self::Item,
_checked: bool,
_window: &mut Window,
_cx: &mut App,
) -> Option<AnyElement>
fn render_item( &self, _ix: IndexPath, _item: &Self::Item, _checked: bool, _window: &mut Window, _cx: &mut App, ) -> Option<AnyElement>
Override the row content for the item at
ix. Read moreSource§fn render_section_header(
&self,
_section: usize,
_window: &mut Window,
_cx: &mut App,
) -> Option<AnyElement>
fn render_section_header( &self, _section: usize, _window: &mut Window, _cx: &mut App, ) -> Option<AnyElement>
Render the header element for the given section (full render access). Read more
Source§fn is_item_enabled(&self, _ix: IndexPath, item: &Self::Item, _cx: &App) -> bool
fn is_item_enabled(&self, _ix: IndexPath, item: &Self::Item, _cx: &App) -> bool
Whether the item at
ix should be rendered as interactive. Read moreSource§fn is_item_checked(
&self,
_ix: IndexPath,
item: &Self::Item,
current_selection: &[(IndexPath, Self::Item)],
_cx: &App,
) -> bool
fn is_item_checked( &self, _ix: IndexPath, item: &Self::Item, current_selection: &[(IndexPath, Self::Item)], _cx: &App, ) -> bool
Whether the item at
ix should show a checkmark. Read moreSource§fn on_will_change(
&mut self,
selection: &mut Vec<(IndexPath, Self::Item)>,
changes: &[SearchableListChange],
)
fn on_will_change( &mut self, selection: &mut Vec<(IndexPath, Self::Item)>, changes: &[SearchableListChange], )
Called before a user-triggered selection change is committed. Read more
Source§fn on_confirm(&mut self, _final_selection: &[(IndexPath, Self::Item)])
fn on_confirm(&mut self, _final_selection: &[(IndexPath, Self::Item)])
Called when the dropdown/popover is committed (Escape,
close_on_select, or explicit
confirm). final_selection is the selection after the last committed change.Auto Trait Implementations§
impl<T> Freeze for SearchableVec<T>
impl<T> RefUnwindSafe for SearchableVec<T>where
Vec<T>: RefUnwindSafe,
impl<T> Send for SearchableVec<T>
impl<T> Sync for SearchableVec<T>
impl<T> Unpin for SearchableVec<T>
impl<T> UnsafeUnpin for SearchableVec<T>where
Vec<T>: UnsafeUnpin,
impl<T> UnwindSafe for SearchableVec<T>where
Vec<T>: UnwindSafe,
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<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