Skip to main content

DeriveRead

Trait DeriveRead 

Source
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§

Source

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.

Source

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.

Source

fn range( &self, start: &[u8], end: &[u8], ) -> Result<Vec<(Vec<u8>, Vec<u8>)>, StorageError>

Every live (key, value) with start <= key < end, in key order. An empty end is unbounded above.

§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".

Implementors§