Skip to main content

KeyValueBatch

Trait KeyValueBatch 

Source
pub trait KeyValueBatch {
Show 27 methods // Required methods fn put(&mut self, key: &[u8], value: &[u8]) -> StorageBackendResult<()>; fn delete(&mut self, key: &[u8]) -> StorageBackendResult<()>; fn delete_prefix(&mut self, prefix: &[u8]) -> StorageBackendResult<()>; fn commit(self: Box<Self>) -> StorageBackendResult<()>; // Provided methods fn serializable_participant(&self) -> Option<SerializableTransactionId> { ... } fn observe_serializable_write( &mut self, _predicate: SerializablePredicate<'_>, ) -> StorageBackendResult<()> { ... } fn require_unchanged(&mut self, _key: &[u8]) -> StorageBackendResult<()> { ... } fn touch_marker( &mut self, _key: &[u8], _value: &[u8], ) -> StorageBackendResult<()> { ... } fn observe_identifier( &mut self, _namespace: &[u8], _value: u64, ) -> StorageBackendResult<()> { ... } fn inherit_identifiers( &mut self, _from: &[u8], _to: &[u8], ) -> StorageBackendResult<()> { ... } fn ivf_mutation( &mut self, _metadata: &[u8], _mutation: IVFMutation<'_>, ) -> StorageBackendResult<()> { ... } fn preview_ivf_record( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()> { ... } fn preview_ivf_prefix(&mut self, prefix: &[u8]) -> StorageBackendResult<()> { ... } fn fence_ivf_prefix(&mut self, _prefix: &[u8]) -> StorageBackendResult<()> { ... } fn hnsw_mutation( &mut self, _metadata: &[u8], _mutation: HNSWMutation<'_>, ) -> StorageBackendResult<()> { ... } fn preview_hnsw_record( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()> { ... } fn preview_hnsw_prefix(&mut self, prefix: &[u8]) -> StorageBackendResult<()> { ... } fn fence_hnsw_prefix(&mut self, _prefix: &[u8]) -> StorageBackendResult<()> { ... } fn replace_occurrence_record( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()> { ... } fn invalidate_occurrence_prefix( &mut self, prefix: &[u8], ) -> StorageBackendResult<()> { ... } fn occurrence_document( &mut self, _table: &str, _document: DocId, ) -> StorageBackendResult<()> { ... } fn reset_occurrences(&mut self, _table: &str) -> StorageBackendResult<()> { ... } fn fence_record(&mut self, _key: &[u8]) -> StorageBackendResult<()> { ... } fn replace_statistics_maintenance( &mut self, key: &[u8], value: &[u8], ) -> StorageBackendResult<()> { ... } fn graph_mutation( &mut self, _mutation: GraphMutation<'_>, ) -> StorageBackendResult<()> { ... } fn preview_graph_invalidation( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()> { ... } fn replace_graph_cache( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()> { ... }
}
Expand description

Atomic mutation buffer for a KeyValueStore.

Required Methods§

Source

fn put(&mut self, key: &[u8], value: &[u8]) -> StorageBackendResult<()>

Source

fn delete(&mut self, key: &[u8]) -> StorageBackendResult<()>

Source

fn delete_prefix(&mut self, prefix: &[u8]) -> StorageBackendResult<()>

Source

fn commit(self: Box<Self>) -> StorageBackendResult<()>

Provided Methods§

Source

fn serializable_participant(&self) -> Option<SerializableTransactionId>

Original SSI participant captured with this evaluated mutation. Wrappers must forward this capability; a batch cannot move to another participant before publication.

Source

fn observe_serializable_write( &mut self, _predicate: SerializablePredicate<'_>, ) -> StorageBackendResult<()>

Stage a logical write with the evaluated records. Failed application discards its new intents and records together while retaining already established dependencies. Providers without this capability reject the request.

Source

fn require_unchanged(&mut self, _key: &[u8]) -> StorageBackendResult<()>

Require this record’s original committed revision at publication without replacing it. This permits independent data writers to share a definition. Stores without commit-time read validation reject this operation; capable wrappers must forward it.

Source

fn touch_marker( &mut self, _key: &[u8], _value: &[u8], ) -> StorageBackendResult<()>

Publish a new revision of an immutable marker, merging concurrent touches of the same value. Structural changes fence the marker and replace their definition; data changes require the definition and touch the marker. The payload must contain only immutable owner/format data. Capable wrappers must forward this operation.

Source

fn observe_identifier( &mut self, _namespace: &[u8], _value: u64, ) -> StorageBackendResult<()>

Stage a durable identifier observation before publishing this batch’s records. Successful observations survive later transaction/savepoint rollback. Dropping an unevaluated batch consumes nothing. Stores without autonomous allocation reject this operation; capable wrappers must forward it.

Source

fn inherit_identifiers( &mut self, _from: &[u8], _to: &[u8], ) -> StorageBackendResult<()>

Carry the source’s durable identifier watermark into the target before this batch publishes its records. Successful watermark updates survive undo, just like observations. Owning lifecycle code must coordinate the accompanying definition change with data writers. Capable wrappers must forward this namespace operation.

Source

fn ivf_mutation( &mut self, _metadata: &[u8], _mutation: IVFMutation<'_>, ) -> StorageBackendResult<()>

Retain already evaluated document input in the same atomic batch as its canonical values and IVF preview. Concurrent wrappers must forward this call.

Source

fn preview_ivf_record( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()>

The immutable preview serves private reads; concurrent commit preparation may replace it with an internally recalculated generation.

Source

fn preview_ivf_prefix(&mut self, prefix: &[u8]) -> StorageBackendResult<()>

Source

fn fence_ivf_prefix(&mut self, _prefix: &[u8]) -> StorageBackendResult<()>

Fence each existing IVF definition under this metadata prefix, including definitions with no vectors. Serialized stores already exclude competing writers.

Source

fn hnsw_mutation( &mut self, _metadata: &[u8], _mutation: HNSWMutation<'_>, ) -> StorageBackendResult<()>

Retain already evaluated document input in the same atomic batch as its canonical values and HNSW preview. Concurrent wrappers must forward this call.

Source

fn preview_hnsw_record( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()>

The immutable preview serves private reads; concurrent commit preparation may replace it with an internally recalculated generation.

Source

fn preview_hnsw_prefix(&mut self, prefix: &[u8]) -> StorageBackendResult<()>

Source

fn fence_hnsw_prefix(&mut self, _prefix: &[u8]) -> StorageBackendResult<()>

Fence each existing HNSW definition under this metadata prefix, including definitions with no vectors. Serialized stores already exclude competing writers.

Source

fn replace_occurrence_record( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()>

Stage an evaluated occurrence cluster, field total or source marker using the persistence’s declared record layout. Source mutations must include their format marker and document guards. Concurrent stores merge only these explicitly typed replacements; ordinary byte writes remain conditional replacements.

Source

fn invalidate_occurrence_prefix( &mut self, prefix: &[u8], ) -> StorageBackendResult<()>

Stage source-owned occurrence-cache invalidation. The source marker in the same batch also drives discovery of caches published after the retained source view.

Source

fn occurrence_document( &mut self, _table: &str, _document: DocId, ) -> StorageBackendResult<()>

Protect whole-document replacement even when two writers select different fields of an originally absent document.

Source

fn reset_occurrences(&mut self, _table: &str) -> StorageBackendResult<()>

Fence a structural occurrence change, including an empty rebuild, drop, purge or rename. Serialized projections already retain their native mutation boundary.

Source

fn fence_record(&mut self, _key: &[u8]) -> StorageBackendResult<()>

Retain the original precondition and current value of a record, including an absent tombstone, before later replacements. Concurrent wrappers must forward this call; serialized stores already exclude intervening writers.

Source

fn replace_statistics_maintenance( &mut self, key: &[u8], value: &[u8], ) -> StorageBackendResult<()>

Stage an evaluated statistics-maintenance replacement using the provider’s declared layout. Keep ordinary metadata writes canonical.

Source

fn graph_mutation( &mut self, _mutation: GraphMutation<'_>, ) -> StorageBackendResult<()>

Record graph-cache dependencies in the same atomic batch. Concurrent MVCC stores must resolve these logical effects before admitting a commit; serialized legacy stores use the ordinary preview writes already included by the catalog.

Source

fn preview_graph_invalidation( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()>

Maintain read-your-writes for a graph invalidation. MVCC replaces this preview with effects selected from current graph ownership at commit.

Source

fn replace_graph_cache( &mut self, key: &[u8], value: Option<&[u8]>, ) -> StorageBackendResult<()>

Replace or clear derived graph cache state. Publishing a completed build must also record GraphMutation::PublishPath so its source dependencies are validated.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§