Struct async_mwmr::TransactionDB
source · pub struct TransactionDB<D, S: AsyncSpawner, H = RandomState> { /* private fields */ }
Expand description
A multi-writer multi-reader MVCC, ACID, Serializable Snapshot Isolation transaction manager.
Implementations§
source§impl<D, S, H> TransactionDB<D, S, H>where
D: AsyncDatabase,
D::Key: Eq + Hash + Send + Sync + 'static,
D::Value: Send + Sync + 'static,
S: AsyncSpawner,
H: BuildHasher + Default + Clone + Send + Sync + 'static,
impl<D, S, H> TransactionDB<D, S, H>where
D: AsyncDatabase,
D::Key: Eq + Hash + Send + Sync + 'static,
D::Value: Send + Sync + 'static,
S: AsyncSpawner,
H: BuildHasher + Default + Clone + Send + Sync + 'static,
sourcepub async fn write(
&self
) -> WriteTransaction<D, AsyncIndexMapManager<D::Key, D::Value, H>, S, H>
pub async fn write( &self ) -> WriteTransaction<D, AsyncIndexMapManager<D::Key, D::Value, H>, S, H>
Create a new writable transaction with the default pending writes manager to store the pending writes.
source§impl<D: AsyncDatabase, S: AsyncSpawner, H: Clone + 'static> TransactionDB<D, S, H>
impl<D: AsyncDatabase, S: AsyncSpawner, H: Clone + 'static> TransactionDB<D, S, H>
sourcepub async fn write_by<W: AsyncPendingManager>(
&self,
backend: W
) -> WriteTransaction<D, W, S, H>
pub async fn write_by<W: AsyncPendingManager>( &self, backend: W ) -> WriteTransaction<D, W, S, H>
Create a new writable transaction with the given pending writes manager to store the pending writes.
source§impl<D: AsyncDatabase, S: AsyncSpawner, H: Default> TransactionDB<D, S, H>
impl<D: AsyncDatabase, S: AsyncSpawner, H: Default> TransactionDB<D, S, H>
source§impl<D: AsyncDatabase, S: AsyncSpawner, H> TransactionDB<D, S, H>
impl<D: AsyncDatabase, S: AsyncSpawner, H> TransactionDB<D, S, H>
sourcepub async fn with_hasher(
transaction_opts: Options,
database_opts: D::Options,
hasher: H
) -> Result<Self, D::Error>
pub async fn with_hasher( transaction_opts: Options, database_opts: D::Options, hasher: H ) -> Result<Self, D::Error>
Open the database with the given options.
sourcepub fn discard_hint(&self) -> u64
pub fn discard_hint(&self) -> u64
Returns a timestamp which hints that any versions under this timestamp can be discard. This is useful when users want to implement compaction/merge functionality.
sourcepub fn database_options(&self) -> &D::Options
pub fn database_options(&self) -> &D::Options
Returns the options of the database.
sourcepub fn transaction_options(&self) -> &Options
pub fn transaction_options(&self) -> &Options
Returns the options of the transaction.
sourcepub fn database(&self) -> &D
pub fn database(&self) -> &D
Returns underlying database.
Note: You should not use this method get the underlying database and read/write directly. This method is only for you to implement advanced functionalities, such as compaction, merge, etc.
sourcepub async fn read(&self) -> ReadTransaction<D, S, H>
pub async fn read(&self) -> ReadTransaction<D, S, H>
Create a new writable transaction.