StorageBackend

Trait StorageBackend 

Source
pub trait StorageBackend {
    // Required method
    fn get(&self, key: &[u8]) -> Option<Vec<u8>>;

    // Provided method
    fn has(&self, key: &[u8]) -> bool { ... }
}
Expand description

A trait for immutably accessing a storage backend.

A collection of basic read operations that can be performed on a storage backend.

You should only have to interact with this trait if you are implementing a custom storage backend.

Required Methods§

Source

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

Get the value associated with the given key.

Provided Methods§

Source

fn has(&self, key: &[u8]) -> bool

Check if the given key exists in the storage backend.

Implementors§