pub trait KeyValueRead {
Show 16 methods
// Required methods
fn control(&self) -> &StorageReadControl;
fn revision(
&self,
prefixes: &[&[u8]],
) -> StorageBackendResult<KeyValueReadRevision>;
fn visit_value(
&self,
key: &[u8],
visit: &mut ValueReadVisitor<'_>,
) -> StorageBackendResult<()>;
fn visit_prefix(
&self,
prefix: &[u8],
visit: &mut KeyValueReadVisitor<'_>,
) -> StorageBackendResult<()>;
// Provided methods
fn marker_fingerprint(
&self,
_key: &[u8],
) -> StorageBackendResult<Option<[u8; 32]>> { ... }
fn record_revision(
&self,
_key: &[u8],
) -> StorageBackendResult<Option<KeyValueReadRevision>> { ... }
fn retained_source(
&self,
_key: &[u8],
) -> StorageBackendResult<Option<Arc<dyn KeyValueRead + Send + Sync>>> { ... }
fn retain(
&self,
prefixes: &[&[u8]],
) -> StorageBackendResult<Arc<dyn KeyValueRead + Send + Sync>> { ... }
fn visit_values(
&self,
keys: &mut KeyValueReadKeyIterator<'_>,
visit: &mut KeyValuePointVisitor<'_>,
) -> StorageBackendResult<()> { ... }
fn visit_key_presence(
&self,
keys: &mut KeyValueReadKeyIterator<'_>,
visit: &mut KeyPresenceVisitor<'_>,
) -> StorageBackendResult<()> { ... }
fn visit_value_budgeted(
&self,
_key: &[u8],
control: &StorageReadControl,
_visit: &mut ValueReadVisitor<'_>,
) -> StorageBackendResult<()> { ... }
fn visit_value_bounded(
&self,
_key: &[u8],
_max_bytes: usize,
control: &StorageReadControl,
_visit: &mut ValueReadVisitor<'_>,
) -> StorageBackendResult<()> { ... }
fn visit_prefix_after(
&self,
_prefix: &[u8],
_after: Option<&[u8]>,
_limit: usize,
control: &StorageReadControl,
_visit: &mut KeyValueReadVisitor<'_>,
) -> StorageBackendResult<()> { ... }
fn visit_keys_after(
&self,
_prefix: &[u8],
_after: Option<&[u8]>,
_limit: usize,
control: &StorageReadControl,
_visit: &mut KeyReadVisitor<'_>,
) -> StorageBackendResult<()> { ... }
fn contains_prefix_budgeted(
&self,
_prefix: &[u8],
control: &StorageReadControl,
) -> StorageBackendResult<bool> { ... }
fn get(&self, key: &[u8]) -> StorageBackendResult<Option<BudgetedVec<u8>>> { ... }
}Expand description
A fixed read boundary supplied by the store. Borrowed visitors must not reenter persistence; compound reads make successive calls through this same reader.
Required Methods§
fn control(&self) -> &StorageReadControl
fn revision( &self, prefixes: &[&[u8]], ) -> StorageBackendResult<KeyValueReadRevision>
fn visit_value( &self, key: &[u8], visit: &mut ValueReadVisitor<'_>, ) -> StorageBackendResult<()>
fn visit_prefix( &self, prefix: &[u8], visit: &mut KeyValueReadVisitor<'_>, ) -> StorageBackendResult<()>
Provided Methods§
Sourcefn marker_fingerprint(
&self,
_key: &[u8],
) -> StorageBackendResult<Option<[u8; 32]>>
fn marker_fingerprint( &self, _key: &[u8], ) -> StorageBackendResult<Option<[u8; 32]>>
Versioned identity of both committed and private inputs to one shared change marker. Unlike a final record revision, a private marker cannot hide a changed committed input. Unsupported providers return None.
Sourcefn record_revision(
&self,
_key: &[u8],
) -> StorageBackendResult<Option<KeyValueReadRevision>>
fn record_revision( &self, _key: &[u8], ) -> StorageBackendResult<Option<KeyValueReadRevision>>
Identity of one live record on this fixed view. Unlike a view revision, unrelated commits do not change it. Compare identities only for the same logical key; missing records and tombstones return None. Providers without exact committed/private record provenance must reject this capability.
Sourcefn retained_source(
&self,
_key: &[u8],
) -> StorageBackendResult<Option<Arc<dyn KeyValueRead + Send + Sync>>>
fn retained_source( &self, _key: &[u8], ) -> StorageBackendResult<Option<Arc<dyn KeyValueRead + Send + Sync>>>
Read source attached to this exact private metadata replacement. Absence never authorizes opening a newer snapshot. Committed values have no attachment; provider wrappers translate the metadata key but preserve the source’s own key space and controls.
Sourcefn retain(
&self,
prefixes: &[&[u8]],
) -> StorageBackendResult<Arc<dyn KeyValueRead + Send + Sync>>
fn retain( &self, prefixes: &[&[u8]], ) -> StorageBackendResult<Arc<dyn KeyValueRead + Send + Sync>>
Retain this committed/private boundary after the callback returns. Callers may only read the selected prefixes. The default copies selected bytes under this reader’s allowance; versioned providers retain their existing visibility owners without loading values.
Sourcefn visit_values(
&self,
keys: &mut KeyValueReadKeyIterator<'_>,
visit: &mut KeyValuePointVisitor<'_>,
) -> StorageBackendResult<()>
fn visit_values( &self, keys: &mut KeyValueReadKeyIterator<'_>, visit: &mut KeyValuePointVisitor<'_>, ) -> StorageBackendResult<()>
Borrow requested values in input order on this boundary. Key production and callbacks are internal and must not reenter persistence. A false visitor or an error stops before producing the next key; defaults require only ordinary point reads.
Sourcefn visit_key_presence(
&self,
keys: &mut KeyValueReadKeyIterator<'_>,
visit: &mut KeyPresenceVisitor<'_>,
) -> StorageBackendResult<()>
fn visit_key_presence( &self, keys: &mut KeyValueReadKeyIterator<'_>, visit: &mut KeyPresenceVisitor<'_>, ) -> StorageBackendResult<()>
Probe requested identities in input order without loading their values. The default uses the existing key-only scan capability; versioned readers reuse private selection cursors.
Sourcefn visit_value_budgeted(
&self,
_key: &[u8],
control: &StorageReadControl,
_visit: &mut ValueReadVisitor<'_>,
) -> StorageBackendResult<()>
fn visit_value_budgeted( &self, _key: &[u8], control: &StorageReadControl, _visit: &mut ValueReadVisitor<'_>, ) -> StorageBackendResult<()>
Visit one value on this same boundary, charging temporary provider buffers to the supplied query allowance.
Sourcefn visit_value_bounded(
&self,
_key: &[u8],
_max_bytes: usize,
control: &StorageReadControl,
_visit: &mut ValueReadVisitor<'_>,
) -> StorageBackendResult<()>
fn visit_value_bounded( &self, _key: &[u8], _max_bytes: usize, control: &StorageReadControl, _visit: &mut ValueReadVisitor<'_>, ) -> StorageBackendResult<()>
Check a value’s encoded size before provider materialization on this same committed/private view.
Sourcefn visit_prefix_after(
&self,
_prefix: &[u8],
_after: Option<&[u8]>,
_limit: usize,
control: &StorageReadControl,
_visit: &mut KeyValueReadVisitor<'_>,
) -> StorageBackendResult<()>
fn visit_prefix_after( &self, _prefix: &[u8], _after: Option<&[u8]>, _limit: usize, control: &StorageReadControl, _visit: &mut KeyValueReadVisitor<'_>, ) -> StorageBackendResult<()>
Visit at most limit values in key order, strictly after after, without advancing this read boundary.
Sourcefn visit_keys_after(
&self,
_prefix: &[u8],
_after: Option<&[u8]>,
_limit: usize,
control: &StorageReadControl,
_visit: &mut KeyReadVisitor<'_>,
) -> StorageBackendResult<()>
fn visit_keys_after( &self, _prefix: &[u8], _after: Option<&[u8]>, _limit: usize, control: &StorageReadControl, _visit: &mut KeyReadVisitor<'_>, ) -> StorageBackendResult<()>
Visit at most limit live keys in ascending order, strictly after after, without reading their values or advancing this boundary. Capable wrappers must preserve this key-only contract.
Sourcefn contains_prefix_budgeted(
&self,
_prefix: &[u8],
control: &StorageReadControl,
) -> StorageBackendResult<bool>
fn contains_prefix_budgeted( &self, _prefix: &[u8], control: &StorageReadControl, ) -> StorageBackendResult<bool>
Probe live keys on this boundary without materializing their values.
fn get(&self, key: &[u8]) -> StorageBackendResult<Option<BudgetedVec<u8>>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".