pub struct IndexMeta {
pub version: u32,
pub segments: Vec<SegmentMeta>,
}Expand description
The index’s manifest: which segments are active, and what is deleted.
Fields§
§version: u32§segments: Vec<SegmentMeta>Implementations§
Source§impl IndexMeta
impl IndexMeta
Sourcepub fn read(base: &Path) -> Result<Self, String>
pub fn read(base: &Path) -> Result<Self, String>
Read meta.json, or the default when there is none (an index that
has never been committed, or one from before segments).
Sourcepub fn write(&self, base: &Path) -> Result<(), String>
pub fn write(&self, base: &Path) -> Result<(), String>
Write meta.json atomically: a crash leaves the previous manifest,
so the segments it names are still the index.
Sourcepub fn live_vectors(&self) -> usize
pub fn live_vectors(&self) -> usize
Vectors the segments still answer for.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for IndexMeta
impl<'de> Deserialize<'de> for IndexMeta
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for IndexMeta
impl RefUnwindSafe for IndexMeta
impl Send for IndexMeta
impl Sync for IndexMeta
impl Unpin for IndexMeta
impl UnsafeUnpin for IndexMeta
impl UnwindSafe for IndexMeta
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
Mutably borrows from an owned value. Read more