Trait tantivy::DocSet [] [src]

pub trait DocSet {
    fn advance(&mut self) -> bool;
fn doc(&self) -> DocId;
fn size_hint(&self) -> u32; fn skip_next(&mut self, target: DocId) -> SkipResult { ... }
fn fill_buffer(&mut self, buffer: &mut [DocId]) -> usize { ... }
fn next(&mut self) -> Option<DocId> { ... }
fn append_to_bitset(&mut self, bitset: &mut BitSet) { ... } }

Represents an iterable set of sorted doc ids.

Required Methods

Goes to the next element. .advance(...) needs to be called a first time to point to the correct element.

Returns the current document

Returns a best-effort hint of the length of the docset.

Provided Methods

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.

Fills a given mutable buffer with the next doc ids from the DocSet

If that many DocIds are available, the method should fill the entire buffer and return the length of the buffer.

If we reach the end of the DocSet before filling it entirely, then the buffer is filled up to this point, and return value is the number of elements that were filled.

Warning

This method is only here for specific high-performance use case where batching. The normal way to go through the DocId's is to call .advance().

Advances the cursor to the next document None is returned if the iterator has DocSet has already been entirely consumed.

Appends all docs to a bitset.

Implementations on Foreign Types

impl<TDocSet: DocSet + ?Sized> DocSet for Box<TDocSet>
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Implementors