Enum async_mwmr::Item
source · pub enum Item<'a, K, V, B, O> {
Pending(EntryRef<'a, K, V>),
Borrowed(B),
Owned(O),
}
Expand description
An item that is either prefetched or fetched from the database.
Variants§
Pending(EntryRef<'a, K, V>)
A pending item, which means that this item is still in a transaction, and not yet commit to the database.
Borrowed(B)
An item comes from the database, some db implementation is Copy-on-Write, so this enum varint allows such kind of behavior
Owned(O)
An item comes from the database, some db implementation is not Copy-on-Write, so this enum varint allows such kind of behavior
Implementations§
source§impl<'a, K, V, B, O> Item<'a, K, V, B, O>
impl<'a, K, V, B, O> Item<'a, K, V, B, O>
sourcepub fn unwrap_pending(&self) -> EntryRef<'a, K, V>
pub fn unwrap_pending(&self) -> EntryRef<'a, K, V>
sourcepub fn unwrap_borrow(&self) -> &B
pub fn unwrap_borrow(&self) -> &B
sourcepub fn unwrap_owned(self) -> O
pub fn unwrap_owned(self) -> O
sourcepub fn unwrap_owned_ref(&self) -> &O
pub fn unwrap_owned_ref(&self) -> &O
sourcepub fn unwrap_committed(self) -> Either<B, O>
pub fn unwrap_committed(self) -> Either<B, O>
Auto Trait Implementations§
impl<'a, K, V, B, O> Freeze for Item<'a, K, V, B, O>
impl<'a, K, V, B, O> RefUnwindSafe for Item<'a, K, V, B, O>
impl<'a, K, V, B, O> Send for Item<'a, K, V, B, O>
impl<'a, K, V, B, O> Sync for Item<'a, K, V, B, O>
impl<'a, K, V, B, O> Unpin for Item<'a, K, V, B, O>
impl<'a, K, V, B, O> UnwindSafe for Item<'a, K, V, B, O>
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