Trait taple_core::DatabaseCollection
source · pub trait DatabaseCollection: Sync + Send {
// Required methods
fn get(&self, key: &str) -> Result<Vec<u8>, Error>;
fn put(&self, key: &str, data: Vec<u8>) -> Result<(), Error>;
fn del(&self, key: &str) -> Result<(), Error>;
fn iter<'a>(
&'a self,
reverse: bool,
prefix: String
) -> Box<dyn Iterator<Item = (String, Vec<u8>)> + 'a>;
}
Expand description
A trait representing a collection of key-value pairs in a database.
Required Methods§
sourcefn get(&self, key: &str) -> Result<Vec<u8>, Error>
fn get(&self, key: &str) -> Result<Vec<u8>, Error>
Retrieves the value associated with the given key.