pub struct MemoryRecordSnapshot { /* private fields */ }Expand description
One pinned committed sequence. Dropping the last owner releases its lease.
Implementations§
Source§impl MemoryRecordSnapshot
impl MemoryRecordSnapshot
pub fn sequence(&self) -> CommitSequence
Sourcepub fn get(&self, key: &[u8]) -> Option<RecordVersion<SharedRecordValue>>
pub fn get(&self, key: &[u8]) -> Option<RecordVersion<SharedRecordValue>>
Return a revision even if its payload is a tombstone.
Sourcepub fn scan(
&self,
prefix: &[u8],
after: Option<&[u8]>,
limit: usize,
control: &StorageReadControl,
) -> VersionResult<BudgetedVec<ScannedRecord>>
pub fn scan( &self, prefix: &[u8], after: Option<&[u8]>, limit: usize, control: &StorageReadControl, ) -> VersionResult<BudgetedVec<ScannedRecord>>
Read a bounded ordered page, including tombstones for revision checks.
Trait Implementations§
Source§impl CommittedRecordSnapshot for MemoryRecordSnapshot
impl CommittedRecordSnapshot for MemoryRecordSnapshot
Source§fn reclamation_epoch(&self) -> Option<u64>
fn reclamation_epoch(&self) -> Option<u64>
The provider’s tombstone-reclamation epoch captured under the same admission as this snapshot.
None means this provider does not supply reclamation-aware observations. Wrappers must forward the original value, never refresh it from current storage.fn sequence(&self) -> CommitSequence
Source§fn get(
&self,
key: &[u8],
control: &StorageReadControl,
) -> VersionResult<Option<RecordVersion<SharedRecordValue>>>
fn get( &self, key: &[u8], control: &StorageReadControl, ) -> VersionResult<Option<RecordVersion<SharedRecordValue>>>
Return the newest revision at or before this snapshot, including tombstones. Missing identities return
None.Source§fn visit_value_bounded(
&self,
key: &[u8],
max_bytes: usize,
control: &StorageReadControl,
visit: &mut RecordValueVisitor<'_>,
) -> VersionResult<()>
fn visit_value_bounded( &self, key: &[u8], max_bytes: usize, control: &StorageReadControl, visit: &mut RecordValueVisitor<'_>, ) -> VersionResult<()>
Check a live value’s encoded size before provider materialization, without changing revision or tombstone visibility. The default rejects unsupported providers rather than materializing through
get.Source§fn scan(
&self,
prefix: &[u8],
after: Option<&[u8]>,
limit: usize,
control: &StorageReadControl,
) -> VersionResult<BudgetedVec<ScannedRecord>>
fn scan( &self, prefix: &[u8], after: Option<&[u8]>, limit: usize, control: &StorageReadControl, ) -> VersionResult<BudgetedVec<ScannedRecord>>
Return at most
limit unique keys in ascending order, strictly after after, including tombstones. A short page means that the prefix is exhausted at this snapshot; all pages keep the same boundary.Source§fn visit_prefix(
&self,
prefix: &[u8],
after: Option<&[u8]>,
limit: usize,
control: &StorageReadControl,
visit: &mut RecordScanVisitor<'_>,
) -> VersionResult<()>
fn visit_prefix( &self, prefix: &[u8], after: Option<&[u8]>, limit: usize, control: &StorageReadControl, visit: &mut RecordScanVisitor<'_>, ) -> VersionResult<()>
Visit ordered versions until the limit, exhaustion or a visitor returning
false. Implementations with borrowed pages avoid charging their encoded payloads to the caller’s decode allowance.Source§fn provider_snapshot(&self) -> Option<&dyn Any>
fn provider_snapshot(&self) -> Option<&dyn Any>
The provider’s own snapshot type, which its native read paths may serve from physical projections at the same boundary. Wrappers must forward the original provider snapshot.
Source§fn commit_monitor(&self) -> Option<u64>
fn commit_monitor(&self) -> Option<u64>
The value
VersionedPersistence::commit_monitor_version returned before this snapshot was captured. While the monitor still returns it, nothing was committed after the capture began, so this snapshot is the latest one. None when the provider has no monitor. Wrappers must forward the original value.Source§fn adopt_commit_monitor(&self, _monitor: u64) -> bool
fn adopt_commit_monitor(&self, _monitor: u64) -> bool
Take the monitor value another snapshot of this same sequence was captured at. Nothing was committed between the two captures, so this snapshot is the latest one for as long as the monitor returns that value. Returns false when the snapshot cannot change its value, and its holder then keeps the other snapshot instead. Keeping this one keeps what it has already read of its records.
Source§fn metadata(
&self,
key: &[u8],
control: &StorageReadControl,
) -> VersionResult<Option<RecordMetadata>>
fn metadata( &self, key: &[u8], control: &StorageReadControl, ) -> VersionResult<Option<RecordMetadata>>
Read a revision and tombstone marker without materializing its value when the provider supports key-only access.
Source§fn visit_keys(
&self,
prefix: &[u8],
after: Option<&[u8]>,
limit: usize,
control: &StorageReadControl,
visit: &mut RecordKeyVisitor<'_>,
) -> VersionResult<()>
fn visit_keys( &self, prefix: &[u8], after: Option<&[u8]>, limit: usize, control: &StorageReadControl, visit: &mut RecordKeyVisitor<'_>, ) -> VersionResult<()>
Visit ordered record identities, including tombstones, without fetching values from providers with key-only access.
Source§fn visit_last_key(
&self,
prefix: &[u8],
before: Option<&[u8]>,
control: &StorageReadControl,
visit: &mut RecordKeyVisitor<'_>,
) -> VersionResult<()>
fn visit_last_key( &self, prefix: &[u8], before: Option<&[u8]>, control: &StorageReadControl, visit: &mut RecordKeyVisitor<'_>, ) -> VersionResult<()>
Visit the greatest visible identity with this prefix strictly before
before, including a tombstone. Invoke the visitor at most once; providers may seek directly without reading preceding keys or values. The default preserves semantics for providers that only implement forward scans.Source§fn visit_value(
&self,
key: &[u8],
control: &StorageReadControl,
visit: &mut RecordValueVisitor<'_>,
) -> VersionResult<()>
fn visit_value( &self, key: &[u8], control: &StorageReadControl, visit: &mut RecordValueVisitor<'_>, ) -> VersionResult<()>
Borrow provider-owned bytes for an internal storage visitor. Visitors must not reenter this snapshot or execute SQL/user callbacks.
Source§fn visit_values(
&self,
keys: &mut RecordKeyIterator<'_>,
control: &StorageReadControl,
visit: &mut RecordPointVisitor<'_>,
) -> VersionResult<()>
fn visit_values( &self, keys: &mut RecordKeyIterator<'_>, control: &StorageReadControl, visit: &mut RecordPointVisitor<'_>, ) -> VersionResult<()>
Borrow requested values in input order under one optional provider read window. Key production and visitors are internal and must not reenter storage or invoke user code. Produce one key at a time; a false visitor or an error stops before requesting the next key, including duplicate and missing identities.
Source§impl Drop for MemoryRecordSnapshot
impl Drop for MemoryRecordSnapshot
Auto Trait Implementations§
impl !RefUnwindSafe for MemoryRecordSnapshot
impl !UnwindSafe for MemoryRecordSnapshot
impl Freeze for MemoryRecordSnapshot
impl Send for MemoryRecordSnapshot
impl Sync for MemoryRecordSnapshot
impl Unpin for MemoryRecordSnapshot
impl UnsafeUnpin for MemoryRecordSnapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more