Trait oasis_runtime_sdk::storage::Store

source ·
pub trait Store {
    // Required methods
    fn get(&self, key: &[u8]) -> Option<Vec<u8>>;
    fn insert(&mut self, key: &[u8], value: &[u8]);
    fn remove(&mut self, key: &[u8]);
    fn iter(&self) -> Box<dyn Iterator + '_>;
    fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16);
}
Expand description

A key-value store.

Required Methods§

source

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

Fetch entry with given key.

source

fn insert(&mut self, key: &[u8], value: &[u8])

Update entry with given key to the given value.

source

fn remove(&mut self, key: &[u8])

Remove entry with given key.

source

fn iter(&self) -> Box<dyn Iterator + '_>

Returns an iterator over the tree.

source

fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16)

Populate the in-memory tree with nodes for keys starting with given prefixes.

Implementations on Foreign Types§

source§

impl<S: Store + ?Sized> Store for &mut S

source§

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

source§

fn insert(&mut self, key: &[u8], value: &[u8])

source§

fn remove(&mut self, key: &[u8])

source§

fn iter(&self) -> Box<dyn Iterator + '_>

source§

fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16)

source§

impl<S: Store + ?Sized> Store for Box<S>

source§

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

source§

fn insert(&mut self, key: &[u8], value: &[u8])

source§

fn remove(&mut self, key: &[u8])

source§

fn iter(&self) -> Box<dyn Iterator + '_>

source§

fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16)

Implementors§

source§

impl Store for HostStore

source§

impl<M: MKVS> Store for MKVSStore<M>

source§

impl<S: Store> Store for ConfidentialStore<S>

source§

impl<S: Store> Store for OverlayStore<S>

source§

impl<S: Store, D: Digest> Store for HashedStore<S, D>

source§

impl<S: Store, P: AsRef<[u8]>> Store for PrefixStore<S, P>