Skip to main content

ObjectStoreApi

Trait ObjectStoreApi 

Source
pub trait ObjectStoreApi: Send {
    type Index: IndexApi;
    type Cursor: CursorApi;

Show 13 methods // 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(&self, name: &str) -> Self::Index; fn open_cursor<'life0, 'async_trait>( &'life0 mut self, range: Option<KeyRange>, direction: CursorDirection, ) -> Pin<Box<dyn Future<Output = Result<Self::Cursor, IndexedDBError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn open_key_cursor<'life0, 'async_trait>( &'life0 mut self, range: Option<KeyRange>, direction: CursorDirection, ) -> Pin<Box<dyn Future<Output = Result<Self::Cursor, IndexedDBError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait;
}
Expand description

Fakeable IndexedDB object-store contract.

Required Associated Types§

Source

type Index: IndexApi

The index handle this store yields.

Source

type Cursor: CursorApi

The cursor handle this scope yields.

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.

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.

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 and fails if the key already exists.

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 by primary key.

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 by primary key.

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.

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.

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.

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.

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 and returns the delete count.

Source

fn index(&self, name: &str) -> Self::Index

Returns a typed handle for one secondary index.

Source

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

Opens a full-value cursor over the object store.

Source

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

Opens a key-only cursor over the object store.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§