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) -> OpenKeyCursorStoreRequest
pub fn request(&self) -> OpenKeyCursorStoreRequest
Returns the OpenKeyCursorStoreRequest
that was used to obtain this cursor.
sourcepub fn advance(&self, count: u32) -> Result<OpenKeyCursorStoreRequest, Error>
pub fn advance(&self, count: u32) -> Result<OpenKeyCursorStoreRequest, Error>
Advances the cursor through the next count records in range.
sourcepub fn next(
&self,
key: Option<&JsValue>,
) -> Result<OpenKeyCursorStoreRequest, Error>
pub fn next( &self, key: Option<&JsValue>, ) -> Result<OpenKeyCursorStoreRequest, Error>
Advances the cursor to the next record in range matching or after key (if provided).
sourcepub fn next_primary_key(
&self,
key: &JsValue,
primary_key: &JsValue,
) -> Result<OpenKeyCursorStoreRequest, Error>
pub fn next_primary_key( &self, key: &JsValue, primary_key: &JsValue, ) -> Result<OpenKeyCursorStoreRequest, Error>
sourcepub fn update(&self, value: &JsValue) -> Result<UpdateStoreRequest, Error>
pub fn update(&self, value: &JsValue) -> Result<UpdateStoreRequest, Error>
Updated the record pointed at by the cursor with a new value.
sourcepub fn delete(&self) -> Result<DeleteStoreRequest, Error>
pub fn delete(&self) -> Result<DeleteStoreRequest, Error>
Delete the record pointed at by the cursor with a new value.
sourcepub fn into_managed(self) -> ManagedKeyCursor
Available on crate feature futures
only.
pub fn into_managed(self) -> ManagedKeyCursor
futures
only.Returns a managed version of this cursor.
Trait Implementations§
source§impl From<KeyCursor> for ManagedKeyCursor
impl From<KeyCursor> for ManagedKeyCursor
impl Eq for KeyCursor
impl StructuralPartialEq for KeyCursor
Auto Trait Implementations§
impl Freeze for KeyCursor
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)