pub struct IndexedDBCursorSnapshot {
pub index_cursor: bool,
pub keys_only: bool,
pub reverse: bool,
pub unique: bool,
pub entries: Vec<IndexedDBCursorSnapshotEntry>,
pub pos: isize,
}Expand description
Provider-side IndexedDB cursor snapshot.
The snapshot sorts rows, applies IndexedDB range bounds, and implements movement semantics for native Rust providers without exposing wire message types.
Fields§
§index_cursor: boolWhether entry keys contain secondary-index values.
keys_only: boolWhether returned cursor entries should omit records.
reverse: boolWhether entries are ordered from greatest to least key.
unique: boolWhether duplicate index keys are collapsed while iterating.
entries: Vec<IndexedDBCursorSnapshotEntry>Sorted and range-filtered entries used by cursor movement.
pos: isizeCurrent cursor position, or -1 when unpositioned.
Implementations§
Source§impl IndexedDBCursorSnapshot
impl IndexedDBCursorSnapshot
Sourcepub fn new(req: &IndexedDBOpenCursorRequest) -> Self
pub fn new(req: &IndexedDBOpenCursorRequest) -> Self
Creates an empty provider-side cursor snapshot from a native request.
Sourcepub fn load(
&mut self,
entries: Vec<IndexedDBCursorSnapshotEntry>,
range: Option<&KeyRange>,
) -> Result<(), IndexedDBError>
pub fn load( &mut self, entries: Vec<IndexedDBCursorSnapshotEntry>, range: Option<&KeyRange>, ) -> Result<(), IndexedDBError>
Sorts entries, applies the supplied key range, and stores the snapshot.
Sourcepub fn apply_range(
&self,
entries: Vec<IndexedDBCursorSnapshotEntry>,
range: Option<&KeyRange>,
) -> Result<Vec<IndexedDBCursorSnapshotEntry>, IndexedDBError>
pub fn apply_range( &self, entries: Vec<IndexedDBCursorSnapshotEntry>, range: Option<&KeyRange>, ) -> Result<Vec<IndexedDBCursorSnapshotEntry>, IndexedDBError>
Returns entries that satisfy the supplied key range without mutating state.
Sourcepub fn next(
&mut self,
) -> Result<Option<&IndexedDBCursorSnapshotEntry>, IndexedDBError>
pub fn next( &mut self, ) -> Result<Option<&IndexedDBCursorSnapshotEntry>, IndexedDBError>
Advances to the next entry, or returns None when exhausted.
Sourcepub fn continue_to_key(
&mut self,
target: &Value,
) -> Result<Option<&IndexedDBCursorSnapshotEntry>, IndexedDBError>
pub fn continue_to_key( &mut self, target: &Value, ) -> Result<Option<&IndexedDBCursorSnapshotEntry>, IndexedDBError>
Advances to target or the next entry past it for this direction.
Sourcepub fn advance(
&mut self,
count: i32,
) -> Result<Option<&IndexedDBCursorSnapshotEntry>, IndexedDBError>
pub fn advance( &mut self, count: i32, ) -> Result<Option<&IndexedDBCursorSnapshotEntry>, IndexedDBError>
Skips count entries and returns the new current entry.
Sourcepub fn current(&self) -> Result<&IndexedDBCursorSnapshotEntry, IndexedDBError>
pub fn current(&self) -> Result<&IndexedDBCursorSnapshotEntry, IndexedDBError>
Returns the currently positioned entry.
Trait Implementations§
Source§impl Clone for IndexedDBCursorSnapshot
impl Clone for IndexedDBCursorSnapshot
Source§fn clone(&self) -> IndexedDBCursorSnapshot
fn clone(&self) -> IndexedDBCursorSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for IndexedDBCursorSnapshot
impl RefUnwindSafe for IndexedDBCursorSnapshot
impl Send for IndexedDBCursorSnapshot
impl Sync for IndexedDBCursorSnapshot
impl Unpin for IndexedDBCursorSnapshot
impl UnsafeUnpin for IndexedDBCursorSnapshot
impl UnwindSafe for IndexedDBCursorSnapshot
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§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request