pub struct MetadataSnapshot {
pub segments: Vec<SegmentEntry>,
pub vector_indexes: Vec<VectorIndexEntry>,
pub total_blocks: u64,
pub free_list: Vec<Extent>,
pub user_metadata: Vec<u8>,
}Expand description
Point-in-time snapshot of all index metadata, stored in the metadata root block referenced by a root pointer.
Contains the segment directory, vector-index directory, allocator state, and free list — everything needed to reconstruct the index state after a crash.
See [[architecture-storage-format#Root Metadata]].
Fields§
§segments: Vec<SegmentEntry>Live segments and their block locations.
vector_indexes: Vec<VectorIndexEntry>Live per-field vector indexes (HNSW today; algorithm-agnostic). Index-wide artifact, decoupled from segments per [[global-vector-indices]].
total_blocks: u64Total number of data blocks the file spans.
free_list: Vec<Extent>Free block extents available for reuse.
user_metadata: Vec<u8>Opaque application metadata (e.g., serialized field mappings, deletion bitmaps). The storage layer does not interpret this — it just persists and returns the bytes.
Implementations§
Source§impl MetadataSnapshot
impl MetadataSnapshot
Sourcepub fn serialized_size(&self) -> usize
pub fn serialized_size(&self) -> usize
Serialized size in bytes.
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Serialize to bytes for storage in a metadata block.
The output is checksummed by the caller (via xxh3_checksum) and
stored in a block referenced by a root pointer.
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self>
pub fn from_bytes(data: &[u8]) -> Result<Self>
Deserialize from bytes read from a metadata block.
§Errors
Returns LuciError::IndexCorrupted if the data is truncated or
contains invalid values.
Sourcepub fn fits_in_single_block(&self) -> bool
pub fn fits_in_single_block(&self) -> bool
Check that the serialized metadata fits within a single block.
Returns false if overflow chaining would be needed (not yet
implemented).
Trait Implementations§
Source§impl Clone for MetadataSnapshot
impl Clone for MetadataSnapshot
Source§fn clone(&self) -> MetadataSnapshot
fn clone(&self) -> MetadataSnapshot
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 MetadataSnapshot
impl Debug for MetadataSnapshot
impl Eq for MetadataSnapshot
Source§impl PartialEq for MetadataSnapshot
impl PartialEq for MetadataSnapshot
Source§fn eq(&self, other: &MetadataSnapshot) -> bool
fn eq(&self, other: &MetadataSnapshot) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MetadataSnapshot
Auto Trait Implementations§
impl Freeze for MetadataSnapshot
impl RefUnwindSafe for MetadataSnapshot
impl Send for MetadataSnapshot
impl Sync for MetadataSnapshot
impl Unpin for MetadataSnapshot
impl UnsafeUnpin for MetadataSnapshot
impl UnwindSafe for MetadataSnapshot
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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