Struct async_skipdb::comparable::ComparableDb
source · pub struct ComparableDb<K, V, S: AsyncSpawner> { /* private fields */ }Expand description
A concurrent ACID, MVCC in-memory database based on [crossbeam-skiplist][crossbeam_skiplist].
ComparableDb requires key to be Ord and CheapClone.
The CheapClone bound here hints the user that the key should be cheap to clone,
because it will be cloned at least one time during the write transaction.
Comparing to EquivalentDb, ComparableDb does not require key to implement Hash.
But, EquivalentDb has more flexible write transaction APIs.
Implementations§
source§impl<K, V, S: AsyncSpawner> ComparableDb<K, V, S>
impl<K, V, S: AsyncSpawner> ComparableDb<K, V, S>
source§impl<K, V, S: AsyncSpawner> ComparableDb<K, V, S>
impl<K, V, S: AsyncSpawner> ComparableDb<K, V, S>
sourcepub async fn read(
&self
) -> ReadTransaction<K, V, ComparableDb<K, V, S>, BTreeCm<K>, S>
pub async fn read( &self ) -> ReadTransaction<K, V, ComparableDb<K, V, S>, BTreeCm<K>, S>
Create a read transaction.
source§impl<K, V, S> ComparableDb<K, V, S>
impl<K, V, S> ComparableDb<K, V, S>
sourcepub async fn write(&self) -> WriteTransaction<K, V, S>
pub async fn write(&self) -> WriteTransaction<K, V, S>
Create a write transaction.
source§impl<K, V, S> ComparableDb<K, V, S>
impl<K, V, S> ComparableDb<K, V, S>
Trait Implementations§
source§impl<K, V, S: AsyncSpawner> Clone for ComparableDb<K, V, S>
impl<K, V, S: AsyncSpawner> Clone for ComparableDb<K, V, S>
Auto Trait Implementations§
impl<K, V, S> Freeze for ComparableDb<K, V, S>
impl<K, V, S> !RefUnwindSafe for ComparableDb<K, V, S>
impl<K, V, S> Send for ComparableDb<K, V, S>
impl<K, V, S> Sync for ComparableDb<K, V, S>
impl<K, V, S> Unpin for ComparableDb<K, V, S>
impl<K, V, S> !UnwindSafe for ComparableDb<K, V, S>
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