Type Alias SmolOptimisticDb

Source
pub type SmolOptimisticDb<K, V, S = RandomState> = OptimisticDb<K, V, SmolSpawner, S>;
Available on crate feature smol only.
Expand description

Database for smol runtime.

Aliased Type§

pub struct SmolOptimisticDb<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 duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more