pub struct PositionPostingListReader<'a> { /* private fields */ }Expand description
Iterates over a position-aware posting list.
Uses a reusable internal buffer for positions to avoid per-document
heap allocation. Supports advance() to skip intermediate documents
without decoding their position data.
Implementations§
Source§impl<'a> PositionPostingListReader<'a>
impl<'a> PositionPostingListReader<'a>
pub fn len(&self) -> u32
pub fn is_empty(&self) -> bool
Sourcepub fn positions(&self) -> &[u32]
pub fn positions(&self) -> &[u32]
Current document’s positions (valid after next() or advance()).
Sourcepub fn first_position(&self) -> u32
pub fn first_position(&self) -> u32
The first position for the current document. For TF=1 docs (common in phrase queries), this is the only position. Uses cached value, no Vec access.
Sourcepub fn current_tf(&self) -> u32
pub fn current_tf(&self) -> u32
Term frequency of the current document (valid after next/advance).
Sourcepub fn advance(&mut self, target: DocId) -> Option<DocId>
pub fn advance(&mut self, target: DocId) -> Option<DocId>
Advance to the first document >= target, decoding its positions.
Skips intermediate documents without decoding their position data.
Returns the doc_id if found, or None if exhausted.
After calling, use positions() to access the decoded positions.
Sourcepub fn next_doc(&mut self) -> Option<DocId>
pub fn next_doc(&mut self) -> Option<DocId>
Advance to the next document sequentially (no target, no skip check). Faster than advance() when iterating all docs in order. For TF=1 (most common), skips Vec operations entirely.
Sourcepub fn current_doc_id(&self) -> u32
pub fn current_doc_id(&self) -> u32
Current document ID (valid after next() or advance()).
Auto Trait Implementations§
impl<'a> Freeze for PositionPostingListReader<'a>
impl<'a> RefUnwindSafe for PositionPostingListReader<'a>
impl<'a> Send for PositionPostingListReader<'a>
impl<'a> Sync for PositionPostingListReader<'a>
impl<'a> Unpin for PositionPostingListReader<'a>
impl<'a> UnsafeUnpin for PositionPostingListReader<'a>
impl<'a> UnwindSafe for PositionPostingListReader<'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
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>
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>
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