pub trait StorageReadView: Send + Sync {
// Required methods
fn get(
&self,
table: &'static str,
key: &[u8],
) -> Result<Option<Vec<u8>>, StoreError>;
fn prefix_iterator(
&self,
table: &'static str,
prefix: &[u8],
) -> Result<Box<dyn Iterator<Item = PrefixResult> + '_>, StoreError>;
}Expand description
Read-only transaction interface. Provides methods to read data from the database
Required Methods§
Sourcefn get(
&self,
table: &'static str,
key: &[u8],
) -> Result<Option<Vec<u8>>, StoreError>
fn get( &self, table: &'static str, key: &[u8], ) -> Result<Option<Vec<u8>>, StoreError>
Retrieves a value by key from the specified table.
Sourcefn prefix_iterator(
&self,
table: &'static str,
prefix: &[u8],
) -> Result<Box<dyn Iterator<Item = PrefixResult> + '_>, StoreError>
fn prefix_iterator( &self, table: &'static str, prefix: &[u8], ) -> Result<Box<dyn Iterator<Item = PrefixResult> + '_>, StoreError>
Returns an iterator over all key-value pairs with the given prefix.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".