pub trait DeriveRead {
// Required methods
fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, StorageError>;
fn range_prefix(
&self,
prefix: &[u8],
) -> Result<Vec<(Vec<u8>, Vec<u8>)>, StorageError>;
fn range(
&self,
start: &[u8],
end: &[u8],
) -> Result<Vec<(Vec<u8>, Vec<u8>)>, StorageError>;
}Expand description
Read access to the state before a commit, for a Deriver.
Required Methods§
Sourcefn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, StorageError>
fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, StorageError>
Current value of key, or None when absent.
§Errors
Returns StorageError if the underlying read fails.
Sourcefn range_prefix(
&self,
prefix: &[u8],
) -> Result<Vec<(Vec<u8>, Vec<u8>)>, StorageError>
fn range_prefix( &self, prefix: &[u8], ) -> Result<Vec<(Vec<u8>, Vec<u8>)>, StorageError>
Every live (key, value) whose key starts with prefix, in key order.
§Errors
Returns StorageError if the underlying read fails.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".