Struct async_skipdb::equivalent::EquivalentDB
source · pub struct EquivalentDB<K, V, SP, S = RandomState> { /* private fields */ }
Expand description
A concurrent ACID, MVCC in-memory database based on 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 with_options_and_hasher(opts: Options, hasher: S) -> Self
pub async fn with_options_and_hasher(opts: Options, hasher: S) -> Self
Creates a new EquivalentDB
with the given options and 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§
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