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 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.
Sourcepub fn with_max_doc(self, max_doc: u32) -> SegmentMeta
pub fn with_max_doc(self, max_doc: u32) -> SegmentMeta
Updates the max_doc value from the SegmentMeta.
Trait Implementations§
Source§impl Clone for SegmentMeta
impl Clone for SegmentMeta
Source§fn clone(&self) -> SegmentMeta
fn clone(&self) -> SegmentMeta
1.0.0 (const: unstable) · 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 UnsafeUnpin 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>, which can then be
downcast into Box<dyn 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>, which 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.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more