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 to 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
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl 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
Performs the conversion.
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,
Serialize this value into the given Serde serializer. Read more
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
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
sourceimpl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more