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]
impl<'a, A> TermStreamer<'a, A> where
A: Automaton,
pub fn advance(&mut self) -> bool
[src]
pub fn advance(&mut self) -> bool
Advance position the stream on the next item.
Before the first call to .advance()
, the stream
is an unitialized state.
pub fn term_ord(&self) -> TermOrdinal
[src]
pub fn term_ord(&self) -> TermOrdinal
Returns the TermOrdinal
of the given term.
May panic if the called as .advance()
as never
been called before.
pub fn key(&self) -> &[u8]
[src]
pub fn key(&self) -> &[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.
pub fn value(&self) -> &TermInfo
[src]
pub fn value(&self) -> &TermInfo
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()
.
pub fn next(&mut self) -> Option<(&[u8], &TermInfo)>
[src]
pub fn next(&mut self) -> Option<(&[u8], &TermInfo)>
Return the next (key, value)
pair.