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§
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§
Sourcefn normalize_record_key(&self, key: &[u8]) -> Result<Option<Vec<u8>>>
fn normalize_record_key(&self, key: &[u8]) -> Result<Option<Vec<u8>>>
Converts a caller-facing key into its persisted record key.
Sourcefn staged_keys_conflict(&self, left: &[u8], right: &[u8]) -> bool
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.
Sourcefn staged_key_shadows_cached(
&self,
staged_key: &[u8],
cached_key: &[u8],
) -> bool
fn staged_key_shadows_cached( &self, staged_key: &[u8], cached_key: &[u8], ) -> bool
Whether a staged key makes a cached key stale.
Sourcefn staged_key_descends_from(&self, staged_key: &[u8], key: &[u8]) -> bool
fn staged_key_descends_from(&self, staged_key: &[u8], key: &[u8]) -> bool
Whether a staged key is a descendant of a caller-facing key.