Skip to main content

MemoryRecordSnapshot

Struct MemoryRecordSnapshot 

Source
pub struct MemoryRecordSnapshot { /* private fields */ }
Expand description

One pinned committed sequence. Dropping the last owner releases its lease.

Implementations§

Source§

impl MemoryRecordSnapshot

Source

pub fn sequence(&self) -> CommitSequence

Source

pub fn get(&self, key: &[u8]) -> Option<RecordVersion<SharedRecordValue>>

Return a revision even if its payload is a tombstone.

Source

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

Source§

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.
Source§

fn sequence(&self) -> CommitSequence

Source§

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<()>

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

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<()>

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>

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>

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

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

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<()>

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<()>

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<()>

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<()>

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

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.