pub enum Entry<'a, K, V> {
    Ref((&'a K, &'a V)),
    Own(Result<(K, V)>),
}
Expand description

Entry is the API for the content of the DB.

It is an enum that contains either a reference to an in-memory entry or an owned (non-shrared) entry that was read from disk.

Entry has some resemblance to std::borrow::Cow.

Variants§

Implementations§

source§

impl<'a, K, V> Entry<'a, K, V>

source

pub fn try_borrow<'b>(&'b self) -> Result<(&'b K, &'b V)>

source§

impl<'a, K, V> Entry<'a, K, V>
where K: Clone,

source

pub fn into_owned_k(self) -> Result<K>

source§

impl<'a, K, V> Entry<'a, K, V>
where V: Clone,

source

pub fn into_owned_v(self) -> Result<V>

source§

impl<'a, K, V> Entry<'a, K, V>
where K: Clone, V: Clone,

source§

impl<'a, K, V> Entry<'a, K, V>

source

pub fn convert<K2, V2>(self) -> Entry<'a, K2, V2>
where K: Borrow<K2> + Into<K2>, V: Borrow<V2> + Into<V2>,

source§

impl<'a, K, V> Entry<'a, K, OptDatum<V>>

source

pub fn to_option_entry(self) -> Option<Entry<'a, K, V>>

Trait Implementations§

source§

impl<K, V> Mergeable<K> for Entry<'_, K, V>

source§

fn try_borrow<'a>(&'a self) -> Result<&'a K, Error>

source§

impl<K, V, Rhs> TryPartialOrd<Rhs, Error> for Entry<'_, K, V>
where K: PartialOrd<Rhs>,

Auto Trait Implementations§

§

impl<'a, K, V> RefUnwindSafe for Entry<'a, K, V>

§

impl<'a, K, V> Send for Entry<'a, K, V>
where K: Send + Sync, V: Send + Sync,

§

impl<'a, K, V> Sync for Entry<'a, K, V>
where K: Sync, V: Sync,

§

impl<'a, K, V> Unpin for Entry<'a, K, V>
where K: Unpin, V: Unpin,

§

impl<'a, K, V> UnwindSafe for Entry<'a, 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.
§

impl<T> Erased for T