pub struct Cursor { /* private fields */ }Expand description
Represents a cursor for traversing or iterating over multiple records in a database.
Implementations
sourceimpl Cursor
impl Cursor
sourcepub fn source(&self) -> Object
pub fn source(&self) -> Object
Returns the ObjectStore or Index the cursor was opened from.
sourcepub fn direction(&self) -> Result<CursorDirection, Error>
pub fn direction(&self) -> Result<CursorDirection, Error>
Returns the direction of the cursor.
sourcepub fn key(&self) -> Result<JsValue, Error>
pub fn key(&self) -> Result<JsValue, Error>
Returns the key of the cursor. Returns an Error if the cursor is advancing or is finished.
sourcepub fn primary_key(&self) -> Result<JsValue, Error>
pub fn primary_key(&self) -> Result<JsValue, Error>
Returns the effective key of the cursor. Returns an Error if the cursor is advancing or is finished.
sourcepub fn value(&self) -> Result<JsValue, Error>
pub fn value(&self) -> Result<JsValue, Error>
Returns the cursor’s current value. Returns an Error if the cursor is advancing or is finished.
sourcepub fn request(&self) -> StoreRequest
pub fn request(&self) -> StoreRequest
Returns the StoreRequest that was used to obtain this cursor.
sourcepub fn advance(&self, count: u32) -> Result<(), Error>
pub fn advance(&self, count: u32) -> Result<(), Error>
Advances the cursor through the next count records in range.
sourcepub fn next(&self, key: Option<&JsValue>) -> Result<(), Error>
pub fn next(&self, key: Option<&JsValue>) -> Result<(), Error>
Advances the cursor to the next record in range matching or after key (if provided).
sourcepub fn update(&self, value: &JsValue) -> Result<StoreRequest, Error>
pub fn update(&self, value: &JsValue) -> Result<StoreRequest, Error>
Updated the record pointed at by the cursor with a new value.
sourcepub fn delete(&self) -> Result<StoreRequest, Error>
pub fn delete(&self) -> Result<StoreRequest, Error>
Delete the record pointed at by the cursor with a new value.
Trait Implementations
sourceimpl From<Cursor> for IdbCursorWithValue
impl From<Cursor> for IdbCursorWithValue
sourceimpl From<IdbCursorWithValue> for Cursor
impl From<IdbCursorWithValue> for Cursor
sourcefn from(inner: IdbCursorWithValue) -> Self
fn from(inner: IdbCursorWithValue) -> Self
Converts to this type from the input type.
impl Eq for Cursor
impl StructuralEq for Cursor
impl StructuralPartialEq for Cursor
Auto Trait Implementations
impl RefUnwindSafe for Cursor
impl !Send for Cursor
impl !Sync for Cursor
impl Unpin for Cursor
impl UnwindSafe for Cursor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more