Type Alias async_skipdb::optimistic::TokioOptimisticDb

source ·
pub type TokioOptimisticDb<K, V, S = RandomState> = OptimisticDb<K, V, TokioSpawner, S>;
Available on crate feature tokio only.
Expand description

Database for tokio runtime.

Aliased Type§

struct TokioOptimisticDb<K, V, S = RandomState> { /* private fields */ }

Implementations

source§

impl<K, V, SP: AsyncSpawner> OptimisticDb<K, V, SP>

source

pub async fn new() -> Self

Creates a new OptimisticDb with the given options.

source§

impl<K, V, SP, S> OptimisticDb<K, V, SP, S>
where K: Ord + Hash + Eq, S: BuildHasher + Clone, SP: AsyncSpawner,

source

pub async fn write(&self) -> OptimisticTransaction<K, V, SP, S>

Create a write transaction.

source

pub async fn write_with_capacity( &self, capacity: usize ) -> OptimisticTransaction<K, V, SP, S>

Create a write transaction with the given capacity hint.

source§

impl<K, V, SP, S> OptimisticDb<K, V, SP, S>
where K: Ord + Eq + Hash + Send + 'static, V: Send + 'static, SP: AsyncSpawner,

source

pub fn compact(&self)

Compact the database.

source§

impl<K, V, SP: AsyncSpawner, S> OptimisticDb<K, V, SP, S>

source

pub async fn with_hasher(hasher: S) -> Self

Creates a new OptimisticDb with the given hasher.

source

pub async fn version(&self) -> u64

Returns the current read version of the database.

source

pub async fn read( &self ) -> ReadTransaction<K, V, OptimisticDb<K, V, SP, S>, HashCm<K, S>, SP>

Create a read transaction.

Trait Implementations

source§

impl<K, V, SP, S> Clone for OptimisticDb<K, V, SP, S>
where SP: AsyncSpawner,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more