Skip to main content

Readable

Trait Readable 

Source
pub trait Readable {
    // Required methods
    fn get_raw(&self, table: &str, key: &[u8]) -> StoreResult<Option<Vec<u8>>>;
    fn range_raw(
        &self,
        table: &str,
        lo: &[u8],
        hi: &[u8],
    ) -> StoreResult<Vec<(Vec<u8>, Vec<u8>)>>;
}
Expand description

A read view over the store. Both ReadTx and WriteTx implement it, so crate::Table read methods accept either (a write txn reads its own uncommitted writes).

Required Methods§

Source

fn get_raw(&self, table: &str, key: &[u8]) -> StoreResult<Option<Vec<u8>>>

Fetch the raw value bytes for key in table, or None if absent.

Source

fn range_raw( &self, table: &str, lo: &[u8], hi: &[u8], ) -> StoreResult<Vec<(Vec<u8>, Vec<u8>)>>

Return (key, value) byte pairs in the half-open range [lo, hi), in ascending key (byte-lexicographic) order. Because keys are written in the order-preserving encoding (see crate::codec), this is logical key order.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§