pub struct Cursor { /* private fields */ }Expand description
Represents a cursor for traversing or iterating over multiple records in a database.
Implementations§
Source§impl 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.