pub trait StateStoreRead: StaticSendSync {
type Iter: StateStoreReadIter;
type RevIter: StateStoreReadIter;
// Required methods
fn get_keyed_row(
&self,
key: TableKey<Bytes>,
read_options: ReadOptions,
) -> impl StorageFuture<'_, Option<StateStoreKeyedRow>>;
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 get(
&self,
key: TableKey<Bytes>,
read_options: ReadOptions,
) -> impl StorageFuture<'_, Option<Bytes>> { ... }
}
Required Associated Types§
Required Methods§
Sourcefn get_keyed_row(
&self,
key: TableKey<Bytes>,
read_options: ReadOptions,
) -> impl StorageFuture<'_, Option<StateStoreKeyedRow>>
fn get_keyed_row( &self, key: TableKey<Bytes>, read_options: ReadOptions, ) -> impl StorageFuture<'_, Option<StateStoreKeyedRow>>
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,
read_options: ReadOptions,
) -> impl StorageFuture<'_, Self::Iter>
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 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, read_options: ReadOptions, ) -> impl StorageFuture<'_, Self::RevIter>
Provided Methods§
Sourcefn get(
&self,
key: TableKey<Bytes>,
read_options: ReadOptions,
) -> impl StorageFuture<'_, Option<Bytes>>
fn get( &self, key: TableKey<Bytes>, read_options: ReadOptions, ) -> impl StorageFuture<'_, Option<Bytes>>
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.