pub struct QueryRegistry { /* private fields */ }Expand description
Registry for tracking re-query observables and routing table changes. Supports batching of changes to avoid redundant re-queries during rapid updates.
Implementations§
Source§impl QueryRegistry
impl QueryRegistry
Sourcepub fn set_self_ref(&mut self, self_ref: Rc<RefCell<QueryRegistry>>)
pub fn set_self_ref(&mut self, self_ref: Rc<RefCell<QueryRegistry>>)
Sets the self reference for scheduling flush callbacks. Must be called after wrapping in Rc<RefCell<>>.
Sourcepub fn register(
&mut self,
query: Rc<RefCell<ReQueryObservable>>,
table_id: TableId,
)
pub fn register( &mut self, query: Rc<RefCell<ReQueryObservable>>, table_id: TableId, )
Registers a query with its dependent table.
Sourcepub fn on_table_change(&mut self, table_id: TableId, changed_ids: &HashSet<u64>)
pub fn on_table_change(&mut self, table_id: TableId, changed_ids: &HashSet<u64>)
Handles table changes by batching and scheduling a flush. Multiple rapid changes are coalesced into a single re-query.
Sourcepub fn flush(&self)
pub fn flush(&self)
Forces an immediate flush of all pending changes. Useful for testing or when you need synchronous behcynos.
Sourcepub fn query_count(&self) -> usize
pub fn query_count(&self) -> usize
Returns the number of registered queries.
Sourcepub fn has_pending_changes(&self) -> bool
pub fn has_pending_changes(&self) -> bool
Returns whether there are pending changes waiting to be flushed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QueryRegistry
impl !RefUnwindSafe for QueryRegistry
impl !Send for QueryRegistry
impl !Sync for QueryRegistry
impl Unpin for QueryRegistry
impl !UnwindSafe for QueryRegistry
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