pub trait CursorApi: Send {
// Required methods
fn key(&self) -> Option<Value>;
fn primary_key(&self) -> &str;
fn value(&self) -> Result<Record, IndexedDBError>;
fn continue_next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<bool, IndexedDBError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn continue_to_key<'life0, 'async_trait>(
&'life0 mut self,
key: Value,
) -> Pin<Box<dyn Future<Output = Result<bool, IndexedDBError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn advance<'life0, 'async_trait>(
&'life0 mut self,
count: i32,
) -> Pin<Box<dyn Future<Output = Result<bool, IndexedDBError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), IndexedDBError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update<'life0, 'async_trait>(
&'life0 mut self,
value: Record,
) -> Pin<Box<dyn Future<Output = Result<(), IndexedDBError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn close<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<(), IndexedDBError>> + Send + 'async_trait>>
where Self: Sized + 'async_trait;
}Expand description
Fakeable IndexedDB cursor contract.
Required Methods§
Sourcefn primary_key(&self) -> &str
fn primary_key(&self) -> &str
Returns the current row’s primary key.
Sourcefn value(&self) -> Result<Record, IndexedDBError>
fn value(&self) -> Result<Record, IndexedDBError>
Returns the current row value.
Sourcefn continue_next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<bool, IndexedDBError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn continue_next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<bool, IndexedDBError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Advances the cursor by one row.
Sourcefn continue_to_key<'life0, 'async_trait>(
&'life0 mut self,
key: Value,
) -> Pin<Box<dyn Future<Output = Result<bool, IndexedDBError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn continue_to_key<'life0, 'async_trait>(
&'life0 mut self,
key: Value,
) -> Pin<Box<dyn Future<Output = Result<bool, IndexedDBError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Advances the cursor to key, or exhausts it if key does not exist.
Sourcefn advance<'life0, 'async_trait>(
&'life0 mut self,
count: i32,
) -> Pin<Box<dyn Future<Output = Result<bool, IndexedDBError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn advance<'life0, 'async_trait>(
&'life0 mut self,
count: i32,
) -> Pin<Box<dyn Future<Output = Result<bool, IndexedDBError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Skips count rows ahead.
Sourcefn delete<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), IndexedDBError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), IndexedDBError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Deletes the current row and keeps the cursor open.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".