pub trait Engine {
type Error: Into<Error>;
// Required methods
fn set(&mut self, key: Key, value: Value) -> Result<(), Self::Error>;
fn get(&self, key: Key) -> Result<Option<Value>, Self::Error>;
fn delete(&mut self, key: Key) -> Result<(), Self::Error>;
fn scan(
&self,
lower_bound: Option<Key>,
upper_bound: Option<Key>,
) -> Result<Box<dyn Scanner + '_>, Self::Error>;
}Required Associated Types§
Required Methods§
fn set(&mut self, key: Key, value: Value) -> Result<(), Self::Error>
fn get(&self, key: Key) -> Result<Option<Value>, Self::Error>
fn delete(&mut self, key: Key) -> Result<(), Self::Error>
fn scan( &self, lower_bound: Option<Key>, upper_bound: Option<Key>, ) -> Result<Box<dyn Scanner + '_>, Self::Error>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".