pub trait ApplyEngine {
// Required methods
fn schema_hlc(&self, array: &str) -> ArrayResult<Option<Hlc>>;
fn already_seen(&self, array: &str, hlc: Hlc) -> ArrayResult<bool>;
fn apply_put(&mut self, op: &ArrayOp) -> ArrayResult<()>;
fn apply_delete(&mut self, op: &ArrayOp) -> ArrayResult<()>;
fn apply_erase(&mut self, op: &ArrayOp) -> ArrayResult<()>;
fn invalidate_tile(
&mut self,
array: &str,
coord: &[CoordValue],
) -> ArrayResult<()>;
}Expand description
Abstract interface to local engine state consumed by apply_op.
Implementations live in nodedb-lite and nodedb crates. The trait is
intentionally not Send + Sync-bounded — implementations choose their
own threading model.
Required Methods§
Sourcefn schema_hlc(&self, array: &str) -> ArrayResult<Option<Hlc>>
fn schema_hlc(&self, array: &str) -> ArrayResult<Option<Hlc>>
Return the current schema HLC for array, or None if the array is
not known to this replica.
Sourcefn already_seen(&self, array: &str, hlc: Hlc) -> ArrayResult<bool>
fn already_seen(&self, array: &str, hlc: Hlc) -> ArrayResult<bool>
Return true if hlc has already been applied to array.
Used for idempotent re-delivery detection.
Sourcefn apply_put(&mut self, op: &ArrayOp) -> ArrayResult<()>
fn apply_put(&mut self, op: &ArrayOp) -> ArrayResult<()>
Apply a Put op to the engine.
Sourcefn apply_delete(&mut self, op: &ArrayOp) -> ArrayResult<()>
fn apply_delete(&mut self, op: &ArrayOp) -> ArrayResult<()>
Apply a Delete op to the engine.
Sourcefn apply_erase(&mut self, op: &ArrayOp) -> ArrayResult<()>
fn apply_erase(&mut self, op: &ArrayOp) -> ArrayResult<()>
Apply an Erase op to the engine.
Sourcefn invalidate_tile(
&mut self,
array: &str,
coord: &[CoordValue],
) -> ArrayResult<()>
fn invalidate_tile( &mut self, array: &str, coord: &[CoordValue], ) -> ArrayResult<()>
Invalidate any tile-cache entry covering coord in array.
Called after every successful op application so that subsequent reads see the updated state.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".