pub struct IncrementalEvaluator { /* private fields */ }Expand description
Wraps SemiNaiveEvaluator to support incremental updates: add new base
facts without discarding previously derived knowledge.
Implementations§
Source§impl IncrementalEvaluator
impl IncrementalEvaluator
Sourcepub fn new(rules: Vec<Rule>, initial_edb: Edb) -> Result<Self, QueryError>
pub fn new(rules: Vec<Rule>, initial_edb: Edb) -> Result<Self, QueryError>
Create and immediately evaluate the initial EDB.
Sourcepub fn add_facts(
&mut self,
new_facts: Vec<Fact>,
) -> Result<EvalStats, QueryError>
pub fn add_facts( &mut self, new_facts: Vec<Fact>, ) -> Result<EvalStats, QueryError>
Add new base facts to the EDB and propagate their consequences into the IDB.
Only the newly added facts seed the next Δ, so previously computed derived facts are never recomputed from scratch.
Sourcepub fn query(&self, predicate: &str) -> Vec<Fact>
pub fn query(&self, predicate: &str) -> Vec<Fact>
Query the current IDB for all facts of the given predicate.
Sourcepub fn total_derived_facts(&self) -> usize
pub fn total_derived_facts(&self) -> usize
Total number of derived facts currently in the IDB.
Auto Trait Implementations§
impl Freeze for IncrementalEvaluator
impl RefUnwindSafe for IncrementalEvaluator
impl Send for IncrementalEvaluator
impl Sync for IncrementalEvaluator
impl Unpin for IncrementalEvaluator
impl UnsafeUnpin for IncrementalEvaluator
impl UnwindSafe for IncrementalEvaluator
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