pub struct StoreMetadata {
pub version: MetadataVersion,
pub created_at: u64,
pub updated_at: u64,
pub collection_count: u64,
pub total_documents: u64,
pub total_size_bytes: u64,
pub wal_config: StoreWalConfig,
}Expand description
Store metadata stored on disk.
This struct contains all persistent metadata for the store, including global statistics, operational state, and WAL configuration.
Storage limit: 10MB total serialized size
Fields§
§version: MetadataVersionMetadata format version
created_at: u64Store creation timestamp
updated_at: u64Last modification timestamp
collection_count: u64Total number of collections
total_documents: u64Total number of documents across all collections
total_size_bytes: u64Total size of all data (bytes)
wal_config: StoreWalConfigWAL configuration for the store
Implementations§
Source§impl StoreMetadata
impl StoreMetadata
Source§impl StoreMetadata
impl StoreMetadata
Sourcepub fn upgrade_to_current(&mut self) -> Result<(), String>
pub fn upgrade_to_current(&mut self) -> Result<(), String>
Upgrade metadata to the current version if needed
This method handles forward migration of metadata from older versions to the current version. It modifies the metadata in-place.
Sourcepub const fn needs_upgrade(&self) -> bool
pub const fn needs_upgrade(&self) -> bool
Check if metadata needs upgrading
Sourcepub fn add_collection(&mut self)
pub fn add_collection(&mut self)
Add a collection
Sourcepub fn remove_collection(&mut self)
pub fn remove_collection(&mut self)
Remove a collection
Sourcepub fn update_documents(&mut self, document_delta: i64, size_delta: i64)
pub fn update_documents(&mut self, document_delta: i64, size_delta: i64)
Update document statistics
Trait Implementations§
Source§impl Clone for StoreMetadata
impl Clone for StoreMetadata
Source§fn clone(&self) -> StoreMetadata
fn clone(&self) -> StoreMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StoreMetadata
impl Debug for StoreMetadata
Source§impl Default for StoreMetadata
impl Default for StoreMetadata
Source§impl<'de> Deserialize<'de> for StoreMetadata
impl<'de> Deserialize<'de> for StoreMetadata
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 StoreMetadata
impl RefUnwindSafe for StoreMetadata
impl Send for StoreMetadata
impl Sync for StoreMetadata
impl Unpin for StoreMetadata
impl UnwindSafe for StoreMetadata
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