Skip to main content

QueryRegistry

Struct QueryRegistry 

Source
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

Source

pub fn new() -> Self

Creates a new query registry.

Source

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<>>.

Source

pub fn register( &mut self, query: Rc<RefCell<ReQueryObservable>>, table_id: TableId, )

Registers a query with its dependent table.

Source

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.

Source

pub fn flush(&self)

Forces an immediate flush of all pending changes. Useful for testing or when you need synchronous behcynos.

Source

pub fn query_count(&self) -> usize

Returns the number of registered queries.

Source

pub fn has_pending_changes(&self) -> bool

Returns whether there are pending changes waiting to be flushed.

Trait Implementations§

Source§

impl Default for QueryRegistry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.