pub trait KeyValueDbTrait: KeyValueDbTraitMultiReader + Send + Sync + MallocSizeOf {
    // Required methods
    fn delete(&self, key: &[u8]) -> Result<Option<Option<Self::ValueType>>>;
    fn put(
        &self,
        key: &[u8],
        value: &<Self::ValueType as DbValueType>::Type
    ) -> Result<Option<Option<Self::ValueType>>>;

    // Provided methods
    fn delete_with_number_key(
        &self,
        key: i64
    ) -> Result<Option<Option<Self::ValueType>>> { ... }
    fn put_with_number_key(
        &self,
        key: i64,
        value: &<Self::ValueType as DbValueType>::Type
    ) -> Result<Option<Option<Self::ValueType>>> { ... }
}

Required Methods§

source

fn delete(&self, key: &[u8]) -> Result<Option<Option<Self::ValueType>>>

Return Some(maybe_old_value) or None if the db don’t support reading the old value at deletion.

source

fn put( &self, key: &[u8], value: &<Self::ValueType as DbValueType>::Type ) -> Result<Option<Option<Self::ValueType>>>

Provided Methods§

source

fn delete_with_number_key( &self, key: i64 ) -> Result<Option<Option<Self::ValueType>>>

source

fn put_with_number_key( &self, key: i64, value: &<Self::ValueType as DbValueType>::Type ) -> Result<Option<Option<Self::ValueType>>>

Implementors§