pub struct ListCursor<'segment> { /* private fields */ }Expand description
A decoding cursor over one (term, field) posting list.
Two scratch buffers are allocated when the cursor opens and reused for every block, so decode never allocates. Term frequencies are scaled by the field’s weight as they are decoded.
Implementations§
Source§impl ListCursor<'_>
impl ListCursor<'_>
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Rewinds to the first posting.
A cursor already sitting in block zero is rewound without decoding
it again: a re-decode would charge the traversal for work it did not
ask for, and blocks_decoded is a gated counter.
Sourcepub fn current_tf(&mut self) -> Option<u32>
pub fn current_tf(&mut self) -> Option<u32>
Returns the unscaled term frequency at the cursor.
The first call against a block lazily decodes that block’s tf stream.
Sourcepub fn current_weighted_tf(&mut self) -> Option<u64>
pub fn current_weighted_tf(&mut self) -> Option<u64>
Returns the weight-scaled term frequency contribution at the cursor.
Scaled in u64 and left unrounded; the merge divides by 1,000 once,
after summing, exactly as the in-memory merge did.
Sourcepub fn seek(&mut self, row: u32)
pub fn seek(&mut self, row: u32)
Advances to the first posting at or after row.
Skip keys ascend, so the first block that can hold row is a binary
search over the metadata rows. Only the four skip-key bytes of each
row are read while searching; nothing between here and the target is
decoded, which is where block skipping actually pays.
Sourcepub const fn exhausted(&self) -> bool
pub const fn exhausted(&self) -> bool
Returns true when the cursor has passed the last posting.
Sourcepub const fn current_impact(&self) -> BlockImpact
pub const fn current_impact(&self) -> BlockImpact
Returns the impact pair of the block the cursor sits in.
Cached when the block was loaded; no metadata row is re-parsed.
Sourcepub fn impact_for(&self, row: u32) -> Option<BlockImpact>
pub fn impact_for(&self, row: u32) -> Option<BlockImpact>
Returns the impact pair of the block that could contain row.
None when this run provably cannot contribute to row: the
cursor has already advanced past it, or every remaining block ends
below it. Only skip keys and one metadata row are read; nothing is
decoded. This is what lets a traversal bound a candidate it has not
paid to visit.
Sourcepub const fn overall_impact(&self) -> BlockImpact
pub const fn overall_impact(&self) -> BlockImpact
Returns the impact pair dominating every block of the list.
Computed once at seal; reading it costs nothing per query.