pub struct DbTree<K, V> { /* private fields */ }Implementations§
Source§impl<K: DataFormat, V: DataFormat> DbTree<K, V>
impl<K: DataFormat, V: DataFormat> DbTree<K, V>
pub fn new(tree: Tree) -> Self
pub fn read_all(&self) -> impl Iterator<Item = (K, V)>
pub fn read_with_prefix<Prefix: DataFormat>( &self, prefix: &Prefix, ) -> Result<impl Iterator<Item = (K, V)>, DatabaseError>
pub fn restore(&self, key: &K) -> Result<Option<V>, DatabaseError>
pub fn save(&self, key: &K, value: &V) -> Result<(), DatabaseError>
pub fn save_option( &self, key: &K, value: Option<&V>, ) -> Result<(), DatabaseError>
pub fn delete(&self, key: &K) -> Result<bool, DatabaseError>
pub fn delete_with_prefix<Prefix: DataFormat>( &self, prefix: &Prefix, ) -> Result<usize, DatabaseError>
Auto Trait Implementations§
impl<K, V> Freeze for DbTree<K, V>
impl<K, V> !RefUnwindSafe for DbTree<K, V>
impl<K, V> Send for DbTree<K, V>
impl<K, V> Sync for DbTree<K, V>
impl<K, V> Unpin for DbTree<K, V>
impl<K, V> !UnwindSafe for DbTree<K, V>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more