Skip to main content

IncrementalEngine

Struct IncrementalEngine 

Source
pub struct IncrementalEngine<K, V> { /* private fields */ }
Expand description

A dependency-light incremental query engine.

Implementations§

Source§

impl<K, V> IncrementalEngine<K, V>
where K: Ord + Clone,

Source

pub fn new() -> Self

Creates an empty incremental query engine.

Source

pub fn register_query(&mut self, key: K, query: Query<K, V>)

Registers or replaces a query callback for key.

Source

pub fn register_fn<F>(&mut self, key: K, query: F)
where F: for<'a> Fn(&K, &mut QueryFrame<'a, K, V>) -> QueryResult<K, V> + Send + Sync + 'static,

Registers a query callback function for key.

Source

pub fn remove_query(&mut self, key: &K) -> bool

Removes a query and marks its dependents dirty.

Source

pub fn invalidate(&mut self, key: &K) -> Revision

Advances an external observation stamp and invalidates reverse dependents.

Source

pub fn source_revision(&self, key: &K) -> Revision

Returns the current external observation revision for key.

Source

pub fn dirty_keys(&self) -> Vec<K>

Returns dirty memo keys in deterministic order.

Source

pub fn memo_revision(&self, key: &K) -> Option<Revision>

Returns the current memo revision for key, when present.

Source

pub fn memo_fingerprint(&self, key: &K) -> Option<ValueFingerprint>

Returns the current memo fingerprint for key, when present.

Source§

impl<K, V> IncrementalEngine<K, V>
where K: Ord + Clone, V: Clone + FingerprintValue,

Source

pub fn verify(&mut self, key: K) -> QueryResult<K, V>

Verifies a root query using unbounded budgets.

Source

pub fn verify_with_budgets( &mut self, key: K, budgets: QueryBudgets, ) -> QueryResult<K, V>

Verifies a root query using explicit budgets.

Source

pub fn resume( &mut self, token: ContinuationToken, budgets: QueryBudgets, ) -> QueryResult<K, V>

Resumes the root query represented by a continuation token.

Source

pub fn verify_many<I>(&mut self, keys: I) -> QueryResult<K, Vec<(K, V)>>
where I: IntoIterator<Item = K>,

Verifies roots in stable key order using unbounded budgets.

Source

pub fn verify_many_with_budgets<I>( &mut self, keys: I, budgets: QueryBudgets, ) -> QueryResult<K, Vec<(K, V)>>
where I: IntoIterator<Item = K>,

Verifies roots in stable key order using explicit budgets for each root.

Source§

impl<K, V> IncrementalEngine<K, V>
where K: Ord + Clone, V: Clone + FingerprintValue,

Source

pub fn snapshot<I>( &mut self, roots: I, budgets: SnapshotBudgets, ) -> QueryResult<K, GraphSnapshot<K, V>>
where I: IntoIterator<Item = K>,

Exports memo graph state reachable from roots.

Source

pub fn restore_snapshot( &mut self, snapshot: GraphSnapshot<K, V>, ) -> Result<RestoreReport, SnapshotError<K>>

Restores memo graph state and rebuilds reverse dependency edges.

Trait Implementations§

Source§

impl<K, V> Default for IncrementalEngine<K, V>
where K: Ord + Clone,

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<K, V> !RefUnwindSafe for IncrementalEngine<K, V>

§

impl<K, V> !UnwindSafe for IncrementalEngine<K, V>

§

impl<K, V> Freeze for IncrementalEngine<K, V>

§

impl<K, V> Send for IncrementalEngine<K, V>
where K: Send, V: Send,

§

impl<K, V> Sync for IncrementalEngine<K, V>
where K: Sync, V: Sync,

§

impl<K, V> Unpin for IncrementalEngine<K, V>

§

impl<K, V> UnsafeUnpin for IncrementalEngine<K, V>

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.