Struct adana_db::FileDb

source ·
pub struct FileDb<K: Key, V: Value> { /* private fields */ }

Implementations§

source§

impl<K, V> FileDb<K, V>
where K: 'static + Key + DeserializeOwned + Debug, V: 'static + Value + DeserializeOwned + Debug,

source

pub fn get_path(&self) -> &PathBuf

Trait Implementations§

source§

impl<K, V> DbOp<K, V> for FileDb<K, V>
where K: 'static + Key + DeserializeOwned + Debug, V: 'static + Value + DeserializeOwned + Debug,

source§

fn get_current_tree(&self) -> Option<String>

source§

fn flush(&self) -> Result<&'static str>

source§

fn open_tree(&mut self, tree_name: &str) -> Option<bool>

source§

fn tree_names(&self) -> Vec<String>

source§

fn drop_tree(&mut self, tree_name: &str) -> bool

source§

fn clear_tree(&mut self, tree_name: &str) -> bool

source§

fn merge_trees( &mut self, tree_name_source: &str, tree_name_dest: &str ) -> Option<()>

source§

fn merge_current_tree_with(&mut self, tree_name_source: &str) -> Option<()>

source§

fn apply_batch(&mut self, batch: Batch<K, V>) -> Option<()>

source§

fn apply_tree( &mut self, tree_name: &str, consumer: &mut impl FnMut(&mut Tree<K, V>) -> Option<V> ) -> Option<V>

source§

fn open_tree_and_apply( &mut self, tree_name: &str, consumer: &mut impl FnMut(&mut Tree<K, V>) -> Option<V> ) -> Option<V>

source§

impl<K: Debug + Key, V: Debug + Value> Debug for FileDb<K, V>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<K: Key, V: Value> Drop for FileDb<K, V>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<K: Key, V: Value> Op<K, V> for FileDb<K, V>

source§

fn read(&self, k: impl Into<K>, r: impl Fn(&V) -> Option<V>) -> Option<V>

source§

fn insert(&mut self, k: impl Into<K>, v: impl Into<V>) -> Option<V>

source§

fn remove(&mut self, k: impl Into<K>) -> Option<V>

source§

fn clear(&mut self)

source§

fn contains(&self, k: &K) -> Option<bool>

source§

fn len(&self) -> Option<usize>

source§

fn keys(&self) -> Vec<K>

source§

fn list_all(&self) -> BTreeMap<K, V>

source§

fn get_value(&self, k: impl Into<K>) -> Option<V>

source§

fn read_no_op(&self, k: impl Into<K>, r: impl Fn(&V) -> Option<V>) -> Option<V>

source§

fn is_empty(&self) -> bool

Auto Trait Implementations§

§

impl<K, V> Freeze for FileDb<K, V>

§

impl<K, V> !RefUnwindSafe for FileDb<K, V>

§

impl<K, V> Send for FileDb<K, V>

§

impl<K, V> Sync for FileDb<K, V>

§

impl<K, V> Unpin for FileDb<K, V>

§

impl<K, V> !UnwindSafe for FileDb<K, V>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.