pub struct KeyCursor { /* private fields */ }
Expand description
Represents a key cursor for traversing or iterating over multiple records (only keys) in a database.
Implementations§
source§impl KeyCursor
impl KeyCursor
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 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§
source§impl PartialEq for KeyCursor
impl PartialEq for KeyCursor
impl Eq for KeyCursor
impl StructuralEq for KeyCursor
impl StructuralPartialEq for KeyCursor
Auto Trait Implementations§
impl RefUnwindSafe for KeyCursor
impl !Send for KeyCursor
impl !Sync for KeyCursor
impl Unpin for KeyCursor
impl UnwindSafe for KeyCursor
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more