pub trait KVStorage:
Clone
+ Send
+ 'static {
// Required methods
fn get(&self, key: &Key) -> Option<Value>;
fn put_with_option(
&mut self,
key: &Key,
value: &Value,
option: Option<PutOption>,
) -> Result<(), BitCaskError>;
fn delete(&mut self, key: &Key) -> Result<(), BitCaskError>;
fn size(&self) -> usize;
// Provided method
fn put(&mut self, key: &Key, value: &Value) -> Result<(), BitCaskError> { ... }
}
Required Methods§
fn get(&self, key: &Key) -> Option<Value>
fn put_with_option( &mut self, key: &Key, value: &Value, option: Option<PutOption>, ) -> Result<(), BitCaskError>
fn delete(&mut self, key: &Key) -> Result<(), BitCaskError>
fn size(&self) -> usize
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.