Skip to main content

TransactionObjectStoreApi

Trait TransactionObjectStoreApi 

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

    // Required methods
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Record, IndexedDBError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_key<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<String, IndexedDBError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add<'life0, 'async_trait>(
        &'life0 mut self,
        record: Record,
    ) -> Pin<Box<dyn Future<Output = Result<(), IndexedDBError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn put<'life0, 'async_trait>(
        &'life0 mut self,
        record: Record,
    ) -> Pin<Box<dyn Future<Output = Result<(), IndexedDBError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), IndexedDBError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn clear<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), IndexedDBError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_all<'life0, 'async_trait>(
        &'life0 mut self,
        range: Option<KeyRange>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, IndexedDBError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_all_keys<'life0, 'async_trait>(
        &'life0 mut self,
        range: Option<KeyRange>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, IndexedDBError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn count<'life0, 'async_trait>(
        &'life0 mut self,
        range: Option<KeyRange>,
    ) -> Pin<Box<dyn Future<Output = Result<i64, IndexedDBError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete_range<'life0, 'async_trait>(
        &'life0 mut self,
        range: KeyRange,
    ) -> Pin<Box<dyn Future<Output = Result<i64, IndexedDBError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn index<'a>(&'a mut self, name: &str) -> Self::Index<'a>;
}
Expand description

Fakeable transaction-scoped object-store contract.

Required Associated Types§

Source

type Index<'a>: TransactionIndexApi + 'a where Self: 'a

The transaction-scoped index handle.

Required Methods§

Source

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

Loads one record by primary key inside the transaction.

Source

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

Resolves the primary key for id inside the transaction.

Source

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

Inserts a new row inside the transaction.

Source

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

Upserts a row inside the transaction.

Source

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

Deletes one row inside the transaction.

Source

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

Deletes every row in the object store inside the transaction.

Source

fn get_all<'life0, 'async_trait>( &'life0 mut self, range: Option<KeyRange>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Record>, IndexedDBError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Loads every row that matches range inside the transaction.

Source

fn get_all_keys<'life0, 'async_trait>( &'life0 mut self, range: Option<KeyRange>, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, IndexedDBError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Loads every primary key that matches range inside the transaction.

Source

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

Counts rows that match range inside the transaction.

Source

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

Deletes rows that match range inside the transaction.

Source

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

Returns a transaction-scoped secondary index.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§