Struct tantivy::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
sourceimpl 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
sourceimpl Clone for SegmentMeta
impl Clone for SegmentMeta
sourcefn clone(&self) -> SegmentMeta
fn clone(&self) -> SegmentMeta
1.0.0const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for SegmentMeta
impl Debug for SegmentMeta
sourceimpl From<TrackedObject<InnerSegmentMeta>> for SegmentMeta
impl From<TrackedObject<InnerSegmentMeta>> for SegmentMeta
sourcefn from(tracked: TrackedObject<InnerSegmentMeta>) -> SegmentMeta
fn from(tracked: TrackedObject<InnerSegmentMeta>) -> SegmentMeta
sourceimpl Serialize for SegmentMeta
impl Serialize for SegmentMeta
sourcefn 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 RefUnwindSafe for SegmentMeta
impl Send for SegmentMeta
impl Sync for SegmentMeta
impl Unpin for SegmentMeta
impl UnwindSafe for SegmentMeta
Blanket Implementations
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
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>
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 moresourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn 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. Read moresourcefn 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. Read moresourceimpl<T> DowncastSync for Twhere
T: Any + Send + Sync,
impl<T> DowncastSync for Twhere
T: Any + Send + Sync,
sourcefn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send + 'static>
fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send + 'static>
Arc<Trait>
(where Trait: Downcast
) to Arc<Any>
. Arc<Any>
can then be
further downcast
into Arc<ConcreteType>
where ConcreteType
implements Trait
. Read more