pub struct TreeRowFilter<K: ItemKey, T> { /* private fields */ }Expand description
A reusable sort + tree-aware filter over a Vec<TreeRow<K, T>>. Build
it once, apply it to each freshly-sourced row stream (e.g.
inside a TreeDataSlice::set_source closure). See the module docs.
Implementations§
Source§impl<K: ItemKey, T: 'static> TreeRowFilter<K, T>
impl<K: ItemKey, T: 'static> TreeRowFilter<K, T>
Sourcepub fn filter_mode(self, mode: TreeFilterMode) -> Self
pub fn filter_mode(self, mode: TreeFilterMode) -> Self
Set the filter strategy (how ancestors/descendants of a match are kept).
Defaults to TreeFilterMode::default().
Sourcepub fn filter(self, pred: impl Fn(&T) -> bool + 'static) -> Self
pub fn filter(self, pred: impl Fn(&T) -> bool + 'static) -> Self
Set the match predicate over the row item. A row “matches” when pred
returns true; the filter_mode decides what else
stays visible. With no predicate every row is kept.
Sourcepub fn sort(self, cmp: impl Fn(&T, &T) -> Ordering + 'static) -> Self
pub fn sort(self, cmp: impl Fn(&T, &T) -> Ordering + 'static) -> Self
Sort siblings (ascending) by a comparator on the row item. Parent/child structure is preserved — only the order within each parent changes.
Trait Implementations§
Auto Trait Implementations§
impl<K, T> !RefUnwindSafe for TreeRowFilter<K, T>
impl<K, T> !Send for TreeRowFilter<K, T>
impl<K, T> !Sync for TreeRowFilter<K, T>
impl<K, T> !UnwindSafe for TreeRowFilter<K, T>
impl<K, T> Freeze for TreeRowFilter<K, T>
impl<K, T> Unpin for TreeRowFilter<K, T>
impl<K, T> UnsafeUnpin for TreeRowFilter<K, 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