Development Documentation (main branch) - For stable release docs, see docs.rs/eidetica
Skip to main content

RecordProjection

Trait RecordProjection 

Source
pub trait RecordProjection<D: CRDT>: Send + Sync {
    // Required methods
    fn descriptor(&self) -> ProjectionDescriptor;
    fn project_delta(&self, delta: &D, out: &mut RecordMutations) -> Result<()>;
    fn encode_entry_delta(&self, mutations: &RecordMutations) -> Result<D>;

    // Provided methods
    fn normalize_record_key(&self, key: &[u8]) -> Result<Option<Vec<u8>>> { ... }
    fn staged_keys_conflict(&self, left: &[u8], right: &[u8]) -> bool { ... }
    fn staged_key_shadows_cached(
        &self,
        staged_key: &[u8],
        cached_key: &[u8],
    ) -> bool { ... }
    fn staged_key_descends_from(&self, staged_key: &[u8], key: &[u8]) -> bool { ... }
}
Expand description

Converts canonical Entry deltas to and from a Store’s cached record format.

Required Methods§

Provided Methods§

Source

fn normalize_record_key(&self, key: &[u8]) -> Result<Option<Vec<u8>>>

Converts a caller-facing key into its persisted record key.

Source

fn staged_keys_conflict(&self, left: &[u8], right: &[u8]) -> bool

Whether two staged keys conflict.

Transactions retain only the newest staged value for each conflicting pair. The default preserves exact-key projections.

Source

fn staged_key_shadows_cached( &self, staged_key: &[u8], cached_key: &[u8], ) -> bool

Whether a staged key makes a cached key stale.

Source

fn staged_key_descends_from(&self, staged_key: &[u8], key: &[u8]) -> bool

Whether a staged key is a descendant of a caller-facing key.

Implementors§