FileDb

Struct 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>,

Source§

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>,

Source§

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.