pub struct FilterControl<Predicate> { /* private fields */ }Expand description
The control (write) half of a live_filter split — the “pipe pumping in”
that swaps the predicate the paired LiveFilter reads.
Implementations§
Source§impl<Predicate> FilterControl<Predicate>
impl<Predicate> FilterControl<Predicate>
Sourcepub fn replace(&self, next: Predicate)
pub fn replace(&self, next: Predicate)
Replace the predicate wholesale. Every subsequent read of the paired
LiveFilter sees next.
Sourcepub fn update(&self, mutate: impl Fn(&Predicate) -> Predicate)
pub fn update(&self, mutate: impl Fn(&Predicate) -> Predicate)
Read-modify-write the predicate. mutate derives the next predicate from
the current one and may be retried under contention, so it must be pure.
Source§impl<Id: Ord + Clone> FilterControl<IdSet<Id>>
impl<Id: Ord + Clone> FilterControl<IdSet<Id>>
Sourcepub fn apply(&self, update: FilterUpdate<Id>) -> &Self
pub fn apply(&self, update: FilterUpdate<Id>) -> &Self
Apply an IdSet update to the live filter.
Sourcepub fn replace_ids(&self, ids: impl IntoIterator<Item = Id>) -> &Self
pub fn replace_ids(&self, ids: impl IntoIterator<Item = Id>) -> &Self
Replace the live set wholesale from an id iterator.
Trait Implementations§
Auto Trait Implementations§
impl<Predicate> Freeze for FilterControl<Predicate>where
LiveControl<Predicate>: Freeze,
impl<Predicate> RefUnwindSafe for FilterControl<Predicate>where
LiveControl<Predicate>: RefUnwindSafe,
impl<Predicate> Send for FilterControl<Predicate>where
LiveControl<Predicate>: Send,
impl<Predicate> Sync for FilterControl<Predicate>where
LiveControl<Predicate>: Sync,
impl<Predicate> Unpin for FilterControl<Predicate>where
LiveControl<Predicate>: Unpin,
impl<Predicate> UnsafeUnpin for FilterControl<Predicate>where
LiveControl<Predicate>: UnsafeUnpin,
impl<Predicate> UnwindSafe for FilterControl<Predicate>where
LiveControl<Predicate>: 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