Trait snarkvm_dpc::traits::storage::Storage [−][src]
pub trait Storage where
Self: Sized, { const IN_MEMORY: bool; fn open(
path: Option<&Path>,
secondary_path: Option<&Path>
) -> Result<Self, StorageError>; fn get(&self, col: u32, key: &[u8]) -> Result<Option<Vec<u8>>, StorageError>; fn get_col(
&self,
col: u32
) -> Result<Vec<(Box<[u8]>, Box<[u8]>)>, StorageError>; fn get_keys(&self, col: u32) -> Result<Vec<Box<[u8]>>, StorageError>; fn put<K: AsRef<[u8]>, V: AsRef<[u8]>>(
&self,
col: u32,
key: K,
value: V
) -> Result<(), StorageError>; fn batch(&self, batch: DatabaseTransaction) -> Result<(), StorageError>; fn exists(&self, col: u32, key: &[u8]) -> bool; fn try_catch_up_with_primary(&self) -> Result<(), StorageError>; }
Associated Constants
Required methods
Opens the storage object, optionally using the given paths; it gets created if it doesn’t exist.
Returns the value with the given key and belonging to the given column.
Returns all the keys and values belonging to the given column.
Returns all the keys belonging to the given column.
Stores the given key and value in the specified column.
fn batch(&self, batch: DatabaseTransaction) -> Result<(), StorageError>
fn batch(&self, batch: DatabaseTransaction) -> Result<(), StorageError>
Executes the given DatabaseTransaction
as a batch operation.
Returns true
if the given key exists in the speficied column.
fn try_catch_up_with_primary(&self) -> Result<(), StorageError>