Trait tantivy::DocSet
[−]
[src]
pub trait DocSet { fn advance(&mut self) -> bool; fn doc(&self) -> DocId; fn size_hint(&self) -> usize; fn skip_next(&mut self, target: DocId) -> SkipResult { ... } fn next(&mut self) -> Option<DocId> { ... } }
Represents an iterable set of sorted doc ids.
Required Methods
fn advance(&mut self) -> bool
Goes to the next element.
.advance(...)
needs to be called a first time to point to the correct
element.
fn doc(&self) -> DocId
Returns the current document
fn size_hint(&self) -> usize
Returns a best-effort hint of the length of the docset.
Provided Methods
fn skip_next(&mut self, target: DocId) -> SkipResult
After skipping, position the iterator in such a way that .doc()
will return a value greater than or equal to target.
SkipResult expresses whether the target value
was reached, overstepped,
or if the DocSet
was entirely consumed without finding any value
greater or equal to the target
.
WARNING: Calling skip always advances the docset. More specifically, if the docset is already positionned on the target skipping will advance to the next position and return SkipResult::Overstep.
fn next(&mut self) -> Option<DocId>
Advances the cursor to the next document
None is returned if the iterator has DocSet
has already been entirely consumed.
Implementors
impl DocSet for EmptyScorer
impl<'a> DocSet for SegmentPostings<'a>
impl<TDocSet: DocSet> DocSet for IntersectionDocSet<TDocSet>
impl<TDocSet: DocSet + ?Sized> DocSet for Box<TDocSet>
impl<'a, TDocSet: DocSet> DocSet for &'a mut TDocSet