Struct tantivy::termdict::TermMerger
source · [−]pub struct TermMerger<'a> { /* private fields */ }
Expand description
Given a list of sorted term streams, returns an iterator over sorted unique terms.
The item yielded is actually a pair with
- the term
- a slice with the ordinal of the segments containing the term.
Implementations
sourceimpl<'a> TermMerger<'a>
impl<'a> TermMerger<'a>
sourcepub fn new(streams: Vec<TermStreamer<'a>>) -> TermMerger<'a>
pub fn new(streams: Vec<TermStreamer<'a>>) -> TermMerger<'a>
Stream of merged term dictionary
sourcepub fn matching_segments<'b: 'a>(
&'b self
) -> impl 'b + Iterator<Item = (usize, TermOrdinal)>
pub fn matching_segments<'b: 'a>(
&'b self
) -> impl 'b + Iterator<Item = (usize, TermOrdinal)>
Iterator over (segment ordinal, TermOrdinal) sorted by segment ordinal
This method may be called
if Self::advance has been called before
and true
was returned.
sourcepub fn advance(&mut self) -> bool
pub fn advance(&mut self) -> bool
Advance the term iterator to the next term.
Returns true
if there is indeed another term
false
if there is none.
sourcepub fn key(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn key(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Returns the current term.
This method may be called
if Self::advance has been called before
and true
was returned.
sourcepub fn current_segment_ords_and_term_infos<'b: 'a>(
&'b self
) -> impl 'b + Iterator<Item = (usize, TermInfo)>
pub fn current_segment_ords_and_term_infos<'b: 'a>(
&'b self
) -> impl 'b + Iterator<Item = (usize, TermInfo)>
Iterator over (segment ordinal, TermInfo) pairs iterator sorted by the ordinal.
This method may be called
if Self::advance has been called before
and true
was returned.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for TermMerger<'a>
impl<'a> !Send for TermMerger<'a>
impl<'a> !Sync for TermMerger<'a>
impl<'a> Unpin for TermMerger<'a>
impl<'a> !UnwindSafe for TermMerger<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more