Skip to main content

CursorApi

Trait CursorApi 

Source
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§

Source

fn key(&self) -> Option<Value>

Returns the current cursor key.

Source

fn primary_key(&self) -> &str

Returns the current row’s primary key.

Source

fn value(&self) -> Result<Record, IndexedDBError>

Returns the current row value.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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,

Replaces the current row and keeps the cursor open.

Source

fn close<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<(), IndexedDBError>> + Send + 'async_trait>>
where Self: Sized + 'async_trait,

Closes the cursor stream and releases its transport resources.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§