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§
Sourcefn delete(&self, key: &[u8]) -> Result<Option<Option<Self::ValueType>>>
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.
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>>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".