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§
Required Methods§
Sourcefn 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<'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.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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<'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.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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_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.
Sourcefn 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,
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".