ReadableConnection

Trait ReadableConnection 

Source
pub trait ReadableConnection {
    // Required methods
    fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>;
    fn scan(&self, prefix: &[u8]) -> Result<Vec<(Vec<u8>, Vec<u8>)>>;

    // Provided methods
    fn get_path(&self, path: &str) -> Result<Option<Vec<u8>>> { ... }
    fn scan_path(&self, prefix: &str) -> Result<Vec<(String, Vec<u8>)>> { ... }
}
Expand description

Trait for read operations (shared by ReadOnly and ReadWrite connections)

Required Methods§

Source

fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>

Get a value by key

Source

fn scan(&self, prefix: &[u8]) -> Result<Vec<(Vec<u8>, Vec<u8>)>>

Scan keys with a prefix

Provided Methods§

Source

fn get_path(&self, path: &str) -> Result<Option<Vec<u8>>>

Get a value by path

Source

fn scan_path(&self, prefix: &str) -> Result<Vec<(String, Vec<u8>)>>

Scan by path prefix

Implementors§