Struct async_skipdb::equivalent::EquivalentDb
source · pub struct EquivalentDb<K, V, SP: AsyncSpawner, S = RandomState> { /* private fields */ }Expand description
A concurrent ACID, MVCC in-memory database based on [crossbeam-skiplist][crossbeam_skiplist].
EquivalentDb requires key to be Ord and Hash.
Comparing to ComparableDb,
EquivalentDb has more flexible write transaction APIs and no clone happen.
But, ComparableDb does not require the key to implement Hash.
Implementations§
source§impl<K, V, SP: AsyncSpawner> EquivalentDb<K, V, SP>
impl<K, V, SP: AsyncSpawner> EquivalentDb<K, V, SP>
source§impl<K, V, SP: AsyncSpawner, S> EquivalentDb<K, V, SP, S>
impl<K, V, SP: AsyncSpawner, S> EquivalentDb<K, V, SP, S>
sourcepub async fn with_hasher(hasher: S) -> Self
pub async fn with_hasher(hasher: S) -> Self
Creates a new EquivalentDb with the given hasher.
sourcepub async fn read(
&self
) -> ReadTransaction<K, V, EquivalentDb<K, V, SP, S>, HashCm<K, S>, SP>
pub async fn read( &self ) -> ReadTransaction<K, V, EquivalentDb<K, V, SP, S>, HashCm<K, S>, SP>
Create a read transaction.
source§impl<K, V, SP, S> EquivalentDb<K, V, SP, S>
impl<K, V, SP, S> EquivalentDb<K, V, SP, S>
sourcepub async fn write(&self) -> WriteTransaction<K, V, SP, S>
pub async fn write(&self) -> WriteTransaction<K, V, SP, S>
Create a write transaction.
sourcepub async fn write_with_capacity(
&self,
capacity: usize
) -> WriteTransaction<K, V, SP, S>
pub async fn write_with_capacity( &self, capacity: usize ) -> WriteTransaction<K, V, SP, S>
Create a write transaction with the given capacity hint.
Trait Implementations§
source§impl<K, V, SP, S> Clone for EquivalentDb<K, V, SP, S>where
SP: AsyncSpawner,
impl<K, V, SP, S> Clone for EquivalentDb<K, V, SP, S>where
SP: AsyncSpawner,
Auto Trait Implementations§
impl<K, V, SP, S> Freeze for EquivalentDb<K, V, SP, S>
impl<K, V, SP, S = RandomState> !RefUnwindSafe for EquivalentDb<K, V, SP, S>
impl<K, V, SP, S> Send for EquivalentDb<K, V, SP, S>
impl<K, V, SP, S> Sync for EquivalentDb<K, V, SP, S>
impl<K, V, SP, S> Unpin for EquivalentDb<K, V, SP, S>
impl<K, V, SP, S = RandomState> !UnwindSafe for EquivalentDb<K, V, SP, 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