Struct tantivy::DocIdToSegmentOrdinal
source · [−]pub struct DocIdToSegmentOrdinal { /* private fields */ }
Expand description
DocIdToSegmentOrdinal maps from doc_id within a segment to the new segment ordinal for demuxing.
For every source segment there is a DocIdToSegmentOrdinal
to distribute its doc_ids.
Implementations
sourceimpl DocIdToSegmentOrdinal
impl DocIdToSegmentOrdinal
sourcepub fn with_max_doc(max_doc: usize) -> Self
pub fn with_max_doc(max_doc: usize) -> Self
Creates a new DocIdToSegmentOrdinal with size of num_doc_ids.
Initially all doc_ids point to segment ordinal 0 and need to be set
the via set
method.
sourcepub fn max_doc(&self) -> u32
pub fn max_doc(&self) -> u32
Returns the number of documents in this mapping.
It should be equal to the max_doc
of the segment it targets.
sourcepub fn set(&mut self, doc_id: u32, segment_ord: SegmentOrdinal)
pub fn set(&mut self, doc_id: u32, segment_ord: SegmentOrdinal)
Associates a doc_id with an output SegmentOrdinal
.
sourcepub fn iter(&self) -> impl Iterator<Item = SegmentOrdinal> + '_
pub fn iter(&self) -> impl Iterator<Item = SegmentOrdinal> + '_
Iterates over the new SegmentOrdinal in the order of the doc_id.
Trait Implementations
sourceimpl Debug for DocIdToSegmentOrdinal
impl Debug for DocIdToSegmentOrdinal
sourceimpl Default for DocIdToSegmentOrdinal
impl Default for DocIdToSegmentOrdinal
sourcefn default() -> DocIdToSegmentOrdinal
fn default() -> DocIdToSegmentOrdinal
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for DocIdToSegmentOrdinal
impl Send for DocIdToSegmentOrdinal
impl Sync for DocIdToSegmentOrdinal
impl Unpin for DocIdToSegmentOrdinal
impl UnwindSafe for DocIdToSegmentOrdinal
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