Struct tantivy::index::SegmentMeta
source · pub struct SegmentMeta { /* private fields */ }
Expand description
SegmentMeta
contains simple meta information about a segment.
For instance the number of docs it contains, how many are deleted, etc.
Implementations§
source§impl SegmentMeta
impl SegmentMeta
sourcepub fn untrack_temp_docstore(&self)
pub fn untrack_temp_docstore(&self)
Removes the Component::TempStore from the alive list and therefore marks the temp docstore file to be deleted by the garbage collection.
sourcepub fn num_deleted_docs(&self) -> u32
pub fn num_deleted_docs(&self) -> u32
Returns the number of deleted documents.
sourcepub fn list_files(&self) -> HashSet<PathBuf>
pub fn list_files(&self) -> HashSet<PathBuf>
Returns the list of files that are required for the segment meta. Note: Some of the returned files may not exist depending on the state of the segment.
This is useful as the way tantivy removes files is by removing all files that have been created by tantivy and are not used by any segment anymore.
sourcepub fn relative_path(&self, component: SegmentComponent) -> PathBuf
pub fn relative_path(&self, component: SegmentComponent) -> PathBuf
Returns the relative path of a component of our segment.
It just joins the segment id with the extension associated with a segment component.
sourcepub fn max_doc(&self) -> u32
pub fn max_doc(&self) -> u32
Return the highest doc id + 1
If there are no deletes, then num_docs = max_docs and all the doc ids contains in this segment are exactly (0..max_doc).
sourcepub fn delete_opstamp(&self) -> Option<Opstamp>
pub fn delete_opstamp(&self) -> Option<Opstamp>
Returns the Opstamp
of the last delete operation
taken in account in this segment.
sourcepub fn has_deletes(&self) -> bool
pub fn has_deletes(&self) -> bool
Returns true iff the segment meta contains delete information.
Trait Implementations§
source§impl Clone for SegmentMeta
impl Clone for SegmentMeta
source§fn clone(&self) -> SegmentMeta
fn clone(&self) -> SegmentMeta
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SegmentMeta
impl Debug for SegmentMeta
source§impl From<TrackedObject<InnerSegmentMeta>> for SegmentMeta
impl From<TrackedObject<InnerSegmentMeta>> for SegmentMeta
source§fn from(tracked: TrackedObject<InnerSegmentMeta>) -> SegmentMeta
fn from(tracked: TrackedObject<InnerSegmentMeta>) -> SegmentMeta
source§impl Serialize for SegmentMeta
impl Serialize for SegmentMeta
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Auto Trait Implementations§
impl Freeze for SegmentMeta
impl RefUnwindSafe for SegmentMeta
impl Send for SegmentMeta
impl Sync for SegmentMeta
impl Unpin for SegmentMeta
impl UnwindSafe for SegmentMeta
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.