pub trait StateStoreRead: StaticSendSync {
type Iter: StateStoreReadIter;
type RevIter: StateStoreReadIter;
type ChangeLogIter: StateStoreReadChangeLogIter;
// Required methods
fn get_keyed_row(
&self,
key: TableKey<Bytes>,
epoch: u64,
read_options: ReadOptions,
) -> impl Future<Output = StorageResult<Option<StateStoreKeyedRow>>> + Send + '_;
fn iter(
&self,
key_range: TableKeyRange,
epoch: u64,
read_options: ReadOptions,
) -> impl Future<Output = StorageResult<Self::Iter>> + Send + '_;
fn rev_iter(
&self,
key_range: TableKeyRange,
epoch: u64,
read_options: ReadOptions,
) -> impl Future<Output = StorageResult<Self::RevIter>> + Send + '_;
fn iter_log(
&self,
epoch_range: (u64, u64),
key_range: TableKeyRange,
options: ReadLogOptions,
) -> impl Future<Output = StorageResult<Self::ChangeLogIter>> + Send + '_;
// Provided method
fn get(
&self,
key: TableKey<Bytes>,
epoch: u64,
read_options: ReadOptions,
) -> impl Future<Output = StorageResult<Option<Bytes>>> + Send + '_ { ... }
}
Required Associated Types§
type Iter: StateStoreReadIter
type RevIter: StateStoreReadIter
type ChangeLogIter: StateStoreReadChangeLogIter
Required Methods§
sourcefn get_keyed_row(
&self,
key: TableKey<Bytes>,
epoch: u64,
read_options: ReadOptions,
) -> impl Future<Output = StorageResult<Option<StateStoreKeyedRow>>> + Send + '_
fn get_keyed_row( &self, key: TableKey<Bytes>, epoch: u64, read_options: ReadOptions, ) -> impl Future<Output = StorageResult<Option<StateStoreKeyedRow>>> + Send + '_
Point gets a value from the state store.
The result is based on a snapshot corresponding to the given epoch
.
Both full key and the value are returned.
sourcefn iter(
&self,
key_range: TableKeyRange,
epoch: u64,
read_options: ReadOptions,
) -> impl Future<Output = StorageResult<Self::Iter>> + Send + '_
fn iter( &self, key_range: TableKeyRange, epoch: u64, read_options: ReadOptions, ) -> impl Future<Output = StorageResult<Self::Iter>> + Send + '_
Opens and returns an iterator for given prefix_hint
and full_key_range
Internally, prefix_hint
will be used to for checking bloom_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
.
fn rev_iter( &self, key_range: TableKeyRange, epoch: u64, read_options: ReadOptions, ) -> impl Future<Output = StorageResult<Self::RevIter>> + Send + '_
fn iter_log( &self, epoch_range: (u64, u64), key_range: TableKeyRange, options: ReadLogOptions, ) -> impl Future<Output = StorageResult<Self::ChangeLogIter>> + Send + '_
Provided Methods§
sourcefn get(
&self,
key: TableKey<Bytes>,
epoch: u64,
read_options: ReadOptions,
) -> impl Future<Output = StorageResult<Option<Bytes>>> + Send + '_
fn get( &self, key: TableKey<Bytes>, epoch: u64, read_options: ReadOptions, ) -> impl Future<Output = StorageResult<Option<Bytes>>> + Send + '_
Point gets a value from the state store.
The result is based on a snapshot corresponding to the given epoch
.
Only the value is returned.
Object Safety§
This trait is not object safe.