Struct async_skipdb::comparable::ComparableDB
source · pub struct ComparableDB<K, V, S> { /* private fields */ }Expand description
A concurrent ACID, MVCC in-memory database based on 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 with_options(opts: Options) -> Self
pub async fn with_options(opts: Options) -> Self
Creates a new ComparableDB with the given options.
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.
sourcepub async fn write_with_capacity(&self, cap: usize) -> WriteTransaction<K, V, S>
pub async fn write_with_capacity(&self, cap: usize) -> WriteTransaction<K, V, S>
Create a write transaction with the given capacity hint.
source§impl<K, V, S> ComparableDB<K, V, S>
impl<K, V, S> ComparableDB<K, V, S>
Trait Implementations§
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