pub struct BlockMaxPostingListReader<'a> { /* private fields */ }Expand description
Iterates over a block-max posting list, yielding (DocId, TF) pairs.
Supports block-level skipping via advance_to_block() for WAND optimization.
Implementations§
Source§impl<'a> BlockMaxPostingListReader<'a>
impl<'a> BlockMaxPostingListReader<'a>
pub fn new(data: &'a [u8]) -> Self
pub fn is_empty(&self) -> bool
pub fn num_blocks(&self) -> u16
Sourcepub fn block_max_tf(&self, block: u16) -> u16
pub fn block_max_tf(&self, block: u16) -> u16
Max TF for a given block.
Sourcepub fn block_last_doc(&self, block: u16) -> u32
pub fn block_last_doc(&self, block: u16) -> u32
Last doc ID in a given block.
Sourcepub fn advance_shallow(&mut self, target: DocId)
pub fn advance_shallow(&mut self, target: DocId)
Position the block pointer at the block containing target without
decoding individual postings. Used by WAND to read block_max_tf()
for the correct block.
This only updates current_block — it does NOT advance the doc
iteration state. Call advance_to_block() for full block skipping.
Sourcepub fn advance_to_block(&mut self, target: DocId)
pub fn advance_to_block(&mut self, target: DocId)
Skip to the first block whose last_doc_id >= target. Positions the reader at the start of that block.
Sourcepub fn next(&mut self) -> Option<(DocId, u32)>
pub fn next(&mut self) -> Option<(DocId, u32)>
Read the next (DocId, TF) pair, or None if exhausted.
Sourcepub fn current_block_idx(&self) -> u16
pub fn current_block_idx(&self) -> u16
Which block is currently being read.
Auto Trait Implementations§
impl<'a> Freeze for BlockMaxPostingListReader<'a>
impl<'a> RefUnwindSafe for BlockMaxPostingListReader<'a>
impl<'a> Send for BlockMaxPostingListReader<'a>
impl<'a> Sync for BlockMaxPostingListReader<'a>
impl<'a> Unpin for BlockMaxPostingListReader<'a>
impl<'a> UnsafeUnpin for BlockMaxPostingListReader<'a>
impl<'a> UnwindSafe for BlockMaxPostingListReader<'a>
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
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more