pub trait IndexCursor: Send + Debug {
type Row: Send;
// Required method
fn next_batch(
&mut self,
batch_size: usize,
) -> Result<Vec<Self::Row>, StorageError>;
// Provided methods
fn stale_skipped(&self) -> u64 { ... }
fn invisible_skipped(&self) -> u64 { ... }
fn malformed_skipped(&self) -> u64 { ... }
fn is_exhausted(&self) -> bool { ... }
}Expand description
A cursor that yields index entries (row IDs or covering rows) in batches.
Bound to a transaction snapshot at creation time. Supports equality, range, and prefix predicates as available in the storage engine. Unsupported predicate types return an error at open time, not at runtime.
Required Associated Types§
Required Methods§
Sourcefn next_batch(
&mut self,
batch_size: usize,
) -> Result<Vec<Self::Row>, StorageError>
fn next_batch( &mut self, batch_size: usize, ) -> Result<Vec<Self::Row>, StorageError>
Read the next batch of index entries (at most batch_size).
Returns an empty Vec when exhausted.
Stale or deleted row IDs are counted but skipped — they do not
cause premature exhaustion.
Provided Methods§
Sourcefn stale_skipped(&self) -> u64
fn stale_skipped(&self) -> u64
Number of stale rows skipped so far (for diagnostics).
Sourcefn invisible_skipped(&self) -> u64
fn invisible_skipped(&self) -> u64
Number of invisible (MVCC-hidden) entries skipped so far.
Sourcefn malformed_skipped(&self) -> u64
fn malformed_skipped(&self) -> u64
Number of malformed/unparseable entries skipped so far.
Sourcefn is_exhausted(&self) -> bool
fn is_exhausted(&self) -> bool
Whether the cursor has reached the end of its physical scan.
A batch may be empty even before exhaustion when all entries in that batch are invisible or stale, so callers that need to continue over such entries must inspect this flag.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".