pub trait DocSet: Send + Sync {
// Required methods
fn doc(&self) -> DocId;
fn advance(&mut self) -> DocId;
fn size_hint(&self) -> u32;
// Provided method
fn seek(&mut self, target: DocId) -> DocId { ... }
}Expand description
Forward-only cursor over sorted document IDs.
This is the base iteration abstraction. Posting lists, filter cursors, and scorers all implement this trait.
Required Methods§
Sourcefn doc(&self) -> DocId
fn doc(&self) -> DocId
Current document ID, or TERMINATED if exhausted.
Sourcefn advance(&mut self) -> DocId
fn advance(&mut self) -> DocId
Advance to the next document. Returns the new doc ID or TERMINATED.
Provided Methods§
Sourcefn seek(&mut self, target: DocId) -> DocId
fn seek(&mut self, target: DocId) -> DocId
Seek to the first document >= target. Returns doc ID or TERMINATED.