Skip to main content

StateStoreRead

Trait StateStoreRead 

Source
pub trait StateStoreRead: StateStoreGet + StaticSendSync {
    type Iter: StateStoreReadIter;
    type RevIter: StateStoreReadIter;

    // Required methods
    fn iter(
        &self,
        key_range: TableKeyRange,
        read_options: ReadOptions,
    ) -> impl StorageFuture<'_, Self::Iter>;
    fn rev_iter(
        &self,
        key_range: TableKeyRange,
        read_options: ReadOptions,
    ) -> impl StorageFuture<'_, Self::RevIter>;

    // Provided method
    fn read_epoch(&self) -> Option<u64> { ... }
}

Required Associated Types§

Required Methods§

Source

fn iter( &self, key_range: TableKeyRange, read_options: ReadOptions, ) -> impl StorageFuture<'_, Self::Iter>

Opens and returns an iterator for given prefix_hint and full_key_range Internally, prefix_hint will be used for checking the SST filter and full_key_range used for iter. (if the prefix_hint not None, it should be be included in key_range) The returned iterator will iterate data based on a snapshot corresponding to the given epoch.

Source

fn rev_iter( &self, key_range: TableKeyRange, read_options: ReadOptions, ) -> impl StorageFuture<'_, Self::RevIter>

Provided Methods§

Source

fn read_epoch(&self) -> Option<u64>

The resolved epoch of a read snapshot, if this reader has one. Tracing uses this to record a numeric epoch for requests resolved by storage, such as latest committed.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§