Skip to main content

TransactionApi

Trait TransactionApi 

Source
pub trait TransactionApi: Send {
    type ObjectStore<'a>: TransactionObjectStoreApi + 'a
       where Self: 'a;

    // Required methods
    fn object_store<'a>(&'a mut self, name: &str) -> Self::ObjectStore<'a>;
    fn commit<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), IndexedDBError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn abort<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        reason: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), IndexedDBError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Fakeable explicit IndexedDB transaction contract.

Required Associated Types§

Source

type ObjectStore<'a>: TransactionObjectStoreApi + 'a where Self: 'a

The transaction-scoped store handle.

Required Methods§

Source

fn object_store<'a>(&'a mut self, name: &str) -> Self::ObjectStore<'a>

Returns a transaction-scoped object store.

Source

fn commit<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), IndexedDBError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Commits the transaction.

Source

fn abort<'life0, 'life1, 'async_trait>( &'life0 mut self, reason: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), IndexedDBError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Aborts the transaction.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§