Trait KVStorage

Source
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§

Source

fn get(&self, key: &Key) -> Option<Value>

Source

fn put_with_option( &mut self, key: &Key, value: &Value, option: Option<PutOption>, ) -> Result<(), BitCaskError>

Source

fn delete(&mut self, key: &Key) -> Result<(), BitCaskError>

Source

fn size(&self) -> usize

Provided Methods§

Source

fn put(&mut self, key: &Key, value: &Value) -> Result<(), BitCaskError>

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.

Implementors§