Struct tantivy::termdict::TermStreamer[][src]

pub struct TermStreamer<'a, A = AlwaysMatch> where
    A: Automaton
{ /* fields omitted */ }

TermStreamer acts as a cursor over a range of terms of a segment. Terms are guaranteed to be sorted.

Methods

impl<'a, A> TermStreamer<'a, A> where
    A: Automaton
[src]

Advance position the stream on the next item. Before the first call to .advance(), the stream is an unitialized state.

Returns the TermOrdinal of the given term.

May panic if the called as .advance() as never been called before.

Important traits for &'a [u8]

Accesses the current key.

.key() should return the key that was returned by the .next() method.

If the end of the stream as been reached, and .next() has been called and returned None, .key() remains the value of the last key encountered.

Before any call to .next(), .key() returns an empty array.

Accesses the current value.

Calling .value() after the end of the stream will return the last .value() encountered.

Panics

Calling .value() before the first call to .advance() returns V::default().

Return the next (key, value) pair.

Auto Trait Implementations

impl<'a, A> Send for TermStreamer<'a, A> where
    A: Send,
    <A as Automaton>::State: Send

impl<'a, A> Sync for TermStreamer<'a, A> where
    A: Sync,
    <A as Automaton>::State: Sync