Struct tantivy_sstable::Streamer

source ·
pub struct Streamer<'a, TSSTable, A = AlwaysMatch>
where A: Automaton, A::State: Clone, TSSTable: SSTable,
{ /* private fields */ }
Expand description

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

Implementations§

source§

impl<'a, TSSTable> Streamer<'a, TSSTable, AlwaysMatch>
where TSSTable: SSTable,

source

pub fn empty() -> Self

source§

impl<'a, TSSTable, A> Streamer<'a, TSSTable, A>
where A: Automaton, A::State: Clone, TSSTable: SSTable,

source

pub fn advance(&mut self) -> bool

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

source

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.

source

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.

source

pub fn value(&self) -> &TSSTable::Value

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().

source

pub fn next(&mut self) -> Option<(&[u8], &TSSTable::Value)>

Return the next (key, value) pair.

Auto Trait Implementations§

§

impl<'a, TSSTable, A> Freeze for Streamer<'a, TSSTable, A>
where <A as Automaton>::State: Sized, A: Freeze, <TSSTable as SSTable>::ValueReader: Freeze,

§

impl<'a, TSSTable, A = AlwaysMatch> !RefUnwindSafe for Streamer<'a, TSSTable, A>

§

impl<'a, TSSTable, A> Send for Streamer<'a, TSSTable, A>
where <A as Automaton>::State: Sized + Send, A: Send, <TSSTable as SSTable>::ValueReader: Send,

§

impl<'a, TSSTable, A> Sync for Streamer<'a, TSSTable, A>
where <A as Automaton>::State: Sized + Sync, A: Sync, <TSSTable as SSTable>::ValueReader: Sync,

§

impl<'a, TSSTable, A> Unpin for Streamer<'a, TSSTable, A>
where <A as Automaton>::State: Sized + Unpin, A: Unpin, <TSSTable as SSTable>::ValueReader: Unpin,

§

impl<'a, TSSTable, A = AlwaysMatch> !UnwindSafe for Streamer<'a, TSSTable, A>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.