Skip to main content

KeyValueRead

Trait KeyValueRead 

Source
pub trait KeyValueRead {
Show 14 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_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§

Source

fn control(&self) -> &StorageReadControl

Source

fn revision( &self, prefixes: &[&[u8]], ) -> StorageBackendResult<KeyValueReadRevision>

Source

fn visit_value( &self, key: &[u8], visit: &mut ValueReadVisitor<'_>, ) -> StorageBackendResult<()>

Source

fn visit_prefix( &self, prefix: &[u8], visit: &mut KeyValueReadVisitor<'_>, ) -> StorageBackendResult<()>

Provided Methods§

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn contains_prefix_budgeted( &self, _prefix: &[u8], control: &StorageReadControl, ) -> StorageBackendResult<bool>

Probe live keys on this boundary without materializing their values.

Source

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".

Implementations on Foreign Types§

Source§

impl KeyValueRead for Budgeted<OwnedRead>

Source§

fn control(&self) -> &StorageReadControl

Source§

fn revision( &self, prefixes: &[&[u8]], ) -> StorageBackendResult<KeyValueReadRevision>

Source§

fn record_revision( &self, key: &[u8], ) -> StorageBackendResult<Option<KeyValueReadRevision>>

Source§

fn retained_source( &self, key: &[u8], ) -> StorageBackendResult<Option<Arc<dyn KeyValueRead + Send + Sync>>>

Source§

fn retain( &self, prefixes: &[&[u8]], ) -> StorageBackendResult<Arc<dyn KeyValueRead + Send + Sync>>

Source§

fn visit_value( &self, key: &[u8], visit: &mut ValueReadVisitor<'_>, ) -> StorageBackendResult<()>

Source§

fn visit_prefix( &self, prefix: &[u8], visit: &mut KeyValueReadVisitor<'_>, ) -> StorageBackendResult<()>

Source§

fn visit_value_budgeted( &self, key: &[u8], control: &StorageReadControl, visit: &mut ValueReadVisitor<'_>, ) -> StorageBackendResult<()>

Source§

fn visit_value_bounded( &self, key: &[u8], max_bytes: usize, control: &StorageReadControl, visit: &mut ValueReadVisitor<'_>, ) -> StorageBackendResult<()>

Source§

fn visit_prefix_after( &self, prefix: &[u8], after: Option<&[u8]>, limit: usize, control: &StorageReadControl, visit: &mut KeyValueReadVisitor<'_>, ) -> StorageBackendResult<()>

Source§

fn visit_keys_after( &self, prefix: &[u8], after: Option<&[u8]>, limit: usize, control: &StorageReadControl, visit: &mut KeyReadVisitor<'_>, ) -> StorageBackendResult<()>

Source§

fn contains_prefix_budgeted( &self, prefix: &[u8], control: &StorageReadControl, ) -> StorageBackendResult<bool>

Implementors§