pub trait KeyValueBatch {
Show 36 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 put_unused(
&mut self,
key: &[u8],
value: &[u8],
) -> StorageBackendResult<()> { ... }
fn require_unchanged(&mut self, _key: &[u8]) -> StorageBackendResult<()> { ... }
fn require_observed(
&mut self,
_key: &[u8],
_revision: &KeyValueReadRevision,
) -> StorageBackendResult<()> { ... }
fn put_observed(
&mut self,
_key: &[u8],
_value: &[u8],
_revision: &KeyValueReadRevision,
) -> StorageBackendResult<()> { ... }
fn put_with_retained_source(
&mut self,
_key: &[u8],
_value: &[u8],
_source: Arc<dyn KeyValueRead + Send + Sync>,
) -> StorageBackendResult<()> { ... }
fn touch_marker(
&mut self,
_key: &[u8],
_value: &[u8],
) -> StorageBackendResult<()> { ... }
fn replace_diskann_origin(
&mut self,
_key: &[u8],
_value: &[u8],
) -> StorageBackendResult<()> { ... }
fn invalidate_diskann_origin(
&mut self,
key: &[u8],
) -> StorageBackendResult<()> { ... }
fn publish_diskann_population(
&mut self,
_key: &[u8],
_template: &[u8],
_origins: DiskANNOriginReader,
) -> StorageBackendResult<()> { ... }
fn retire_diskann_population(
&mut self,
_key: &[u8],
) -> StorageBackendResult<()> { ... }
fn observe_identifier(
&mut self,
_namespace: &[u8],
_value: u64,
) -> StorageBackendResult<()> { ... }
fn inherit_identifiers(
&mut self,
_from: &[u8],
_to: &[u8],
) -> StorageBackendResult<()> { ... }
fn delete_prefix_allow_absent(
&mut self,
prefix: &[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§
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§
Sourcefn serializable_participant(&self) -> Option<SerializableTransactionId>
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.
Sourcefn observe_serializable_write(
&mut self,
_predicate: SerializablePredicate<'_>,
) -> StorageBackendResult<()>
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.
Sourcefn put_unused(&mut self, key: &[u8], value: &[u8]) -> StorageBackendResult<()>
fn put_unused(&mut self, key: &[u8], value: &[u8]) -> StorageBackendResult<()>
Write a record at a key that never had one, as the caller has established. Such a key has no committed revision, so the write expects none without reading one, and a record that exists after all fails the commit as a write conflict instead of being replaced. The default reads the revision as put does; capable wrappers must forward this method to keep the write blind.
Sourcefn require_unchanged(&mut self, _key: &[u8]) -> StorageBackendResult<()>
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.
Sourcefn require_observed(
&mut self,
_key: &[u8],
_revision: &KeyValueReadRevision,
) -> StorageBackendResult<()>
fn require_observed( &mut self, _key: &[u8], _revision: &KeyValueReadRevision, ) -> StorageBackendResult<()>
Require an actual committed record observed through an independently retained metadata view, without advancing the transaction’s data snapshot. The revision must identify this same key in this database; private and unversioned provenance is rejected. Reserved for storage-owned independently staged resources, not SQL row writes.
Sourcefn put_observed(
&mut self,
_key: &[u8],
_value: &[u8],
_revision: &KeyValueReadRevision,
) -> StorageBackendResult<()>
fn put_observed( &mut self, _key: &[u8], _value: &[u8], _revision: &KeyValueReadRevision, ) -> StorageBackendResult<()>
Replace an independently staged metadata record using its observed committed precondition. Existing private changes to the key are rejected. Commit conflict, savepoint and receipt semantics are the same as other evaluated writes; this does not refresh the caller’s snapshot.
Sourcefn put_with_retained_source(
&mut self,
_key: &[u8],
_value: &[u8],
_source: Arc<dyn KeyValueRead + Send + Sync>,
) -> StorageBackendResult<()>
fn put_with_retained_source( &mut self, _key: &[u8], _value: &[u8], _source: Arc<dyn KeyValueRead + Send + Sync>, ) -> StorageBackendResult<()>
Replace metadata and retain its independently staged read source in the same evaluated private write. The source follows savepoint undo, retained views and original receipt resolution; replacing or deleting the key releases it from the new view. Only the bytes are persisted. Capable wrappers must forward the source unchanged.
Sourcefn touch_marker(
&mut self,
_key: &[u8],
_value: &[u8],
) -> StorageBackendResult<()>
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.
Sourcefn replace_diskann_origin(
&mut self,
_key: &[u8],
_value: &[u8],
) -> StorageBackendResult<()>
fn replace_diskann_origin( &mut self, _key: &[u8], _value: &[u8], ) -> StorageBackendResult<()>
Stage an actual canonical origin with its evaluated complete tensor. Its original write precondition remains strict; common MVCC maintains all selected-generation populations without replaying the mutation. Capable wrappers must forward this operation.
Sourcefn invalidate_diskann_origin(&mut self, key: &[u8]) -> StorageBackendResult<()>
fn invalidate_diskann_origin(&mut self, key: &[u8]) -> StorageBackendResult<()>
Remove the canonical origin invalidated by a raw writer. Concurrent stores reject an existing population unless their complete publication census validates the final canonical view. Validation follows private application, command refresh and final publication, including an originally absent origin. Capable wrappers must forward this operation.
Sourcefn publish_diskann_population(
&mut self,
_key: &[u8],
_template: &[u8],
_origins: DiskANNOriginReader,
) -> StorageBackendResult<()>
fn publish_diskann_population( &mut self, _key: &[u8], _template: &[u8], _origins: DiskANNOriginReader, ) -> StorageBackendResult<()>
Retain already verified complete build origins for one authorized generation publication. The template supplies physical row encoding, not trusted counts; common MVCC computes the private and committed census on their actual canonical views. The catalog/head owner must authorize and guard this publication in the same batch.
Sourcefn retire_diskann_population(&mut self, _key: &[u8]) -> StorageBackendResult<()>
fn retire_diskann_population(&mut self, _key: &[u8]) -> StorageBackendResult<()>
Retire a generation’s population header and witnesses, including witnesses added by intervening disjoint writers. The generation/head owner must retain its original publication guards. This operation follows private undo and original receipt resolution.
Sourcefn observe_identifier(
&mut self,
_namespace: &[u8],
_value: u64,
) -> StorageBackendResult<()>
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.
Sourcefn inherit_identifiers(
&mut self,
_from: &[u8],
_to: &[u8],
) -> StorageBackendResult<()>
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.
Sourcefn delete_prefix_allow_absent(
&mut self,
prefix: &[u8],
) -> StorageBackendResult<()>
fn delete_prefix_allow_absent( &mut self, prefix: &[u8], ) -> StorageBackendResult<()>
Delete only the keys selected by this evaluated prefix, accepting concurrent deletion of those keys. A concurrent live replacement still conflicts, and explicit read requirements remain strict. Reserved for obsolete internal records; callers must separately fence structural changes and new insertions. Concurrent wrappers must forward this operation.
Sourcefn ivf_mutation(
&mut self,
_metadata: &[u8],
_mutation: IVFMutation<'_>,
) -> StorageBackendResult<()>
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.
Sourcefn preview_ivf_record(
&mut self,
key: &[u8],
value: Option<&[u8]>,
) -> StorageBackendResult<()>
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.
fn preview_ivf_prefix(&mut self, prefix: &[u8]) -> StorageBackendResult<()>
Sourcefn fence_ivf_prefix(&mut self, _prefix: &[u8]) -> StorageBackendResult<()>
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.
Sourcefn hnsw_mutation(
&mut self,
_metadata: &[u8],
_mutation: HNSWMutation<'_>,
) -> StorageBackendResult<()>
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.
Sourcefn preview_hnsw_record(
&mut self,
key: &[u8],
value: Option<&[u8]>,
) -> StorageBackendResult<()>
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.
fn preview_hnsw_prefix(&mut self, prefix: &[u8]) -> StorageBackendResult<()>
Sourcefn fence_hnsw_prefix(&mut self, _prefix: &[u8]) -> StorageBackendResult<()>
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.
Sourcefn replace_occurrence_record(
&mut self,
key: &[u8],
value: Option<&[u8]>,
) -> StorageBackendResult<()>
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.
Sourcefn invalidate_occurrence_prefix(
&mut self,
prefix: &[u8],
) -> StorageBackendResult<()>
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.
Sourcefn occurrence_document(
&mut self,
_table: &str,
_document: DocId,
) -> StorageBackendResult<()>
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.
Sourcefn reset_occurrences(&mut self, _table: &str) -> StorageBackendResult<()>
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.
Sourcefn fence_record(&mut self, _key: &[u8]) -> StorageBackendResult<()>
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.
Sourcefn replace_statistics_maintenance(
&mut self,
key: &[u8],
value: &[u8],
) -> StorageBackendResult<()>
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.
Sourcefn graph_mutation(
&mut self,
_mutation: GraphMutation<'_>,
) -> StorageBackendResult<()>
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.
Sourcefn preview_graph_invalidation(
&mut self,
key: &[u8],
value: Option<&[u8]>,
) -> StorageBackendResult<()>
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.
Sourcefn replace_graph_cache(
&mut self,
key: &[u8],
value: Option<&[u8]>,
) -> StorageBackendResult<()>
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".