Trait snarkvm_objects::traits::storage::Storage [−][src]
Required methods
fn in_memory(&self) -> bool[src]
Returns a bool indicating whether the storage is in-memory only.
fn open(
path: Option<&Path>,
secondary_path: Option<&Path>
) -> Result<Self, StorageError>[src]
path: Option<&Path>,
secondary_path: Option<&Path>
) -> Result<Self, StorageError>
Opens the storage object, optionally using the given paths; it gets created if it doesn’t exist.
fn get(&self, col: u32, key: &[u8]) -> Result<Option<Vec<u8>>, StorageError>[src]
Returns the value with the given key and belonging to the given column.
fn get_col(&self, col: u32) -> Result<Vec<(Box<[u8]>, Box<[u8]>)>, StorageError>[src]
Returns all the keys and values belonging to the given column.
fn get_keys(&self, col: u32) -> Result<Vec<Box<[u8]>>, StorageError>[src]
Returns all the keys belonging to the given column.
fn put<K: AsRef<[u8]>, V: AsRef<[u8]>>(
&self,
col: u32,
key: K,
value: V
) -> Result<(), StorageError>[src]
&self,
col: u32,
key: K,
value: V
) -> Result<(), StorageError>
Stores the given key and value in the specified column.
fn batch(&self, batch: DatabaseTransaction) -> Result<(), StorageError>[src]
Executes the given DatabaseTransaction as a batch operation.
fn exists(&self, col: u32, key: &[u8]) -> bool[src]
Returns true if the given key exists in the speficied column.
fn try_catch_up_with_primary(&self) -> Result<(), StorageError>[src]
fn destroy(&self) -> Result<(), StorageError>[src]
Used to remove any persistent objects associated with the storage.