Skip to main content

DocSet

Trait DocSet 

Source
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§

Source

fn doc(&self) -> DocId

Current document ID, or TERMINATED if exhausted.

Source

fn advance(&mut self) -> DocId

Advance to the next document. Returns the new doc ID or TERMINATED.

Source

fn size_hint(&self) -> u32

Estimated number of remaining documents.

Provided Methods§

Source

fn seek(&mut self, target: DocId) -> DocId

Seek to the first document >= target. Returns doc ID or TERMINATED.

Trait Implementations§

Source§

impl DocSet for Box<dyn DocSet + '_>

Source§

fn doc(&self) -> DocId

Current document ID, or TERMINATED if exhausted.
Source§

fn advance(&mut self) -> DocId

Advance to the next document. Returns the new doc ID or TERMINATED.
Source§

fn seek(&mut self, target: DocId) -> DocId

Seek to the first document >= target. Returns doc ID or TERMINATED.
Source§

fn size_hint(&self) -> u32

Estimated number of remaining documents.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl DocSet for Box<dyn DocSet + '_>

Source§

fn doc(&self) -> DocId

Source§

fn advance(&mut self) -> DocId

Source§

fn seek(&mut self, target: DocId) -> DocId

Source§

fn size_hint(&self) -> u32

Implementors§