pub struct MnemoConfig {
pub dimensions: usize,
pub kdf: KdfParams,
pub wal_pages_initial: u64,
pub max_snapshots: usize,
}Expand description
Configuration for creating a new database.
Fields§
§dimensions: usizeEmbedding dimensionality. Every stored vector must match this.
kdf: KdfParamsKey-derivation parameters.
wal_pages_initial: u64Initial size of the WAL region in 8 KiB pages. Default is
[DEFAULT_WAL_PAGES] (8 pages = 64 KiB), which keeps fresh files
small; the region auto-grows when a transaction’s control plane needs
more space, so raising this is only a hint for the expected steady-state
transaction size. Write-heavy databases that routinely flush large
catalogs or ANN indexes can set this higher (e.g. 64 = 512 KiB) to
avoid early grow events; tiny embedded uses can leave it at the
default. Clamped to a minimum of [MIN_WAL_PAGES] (2 pages).
max_snapshots: usizeMaximum number of snapshot manifest entries to retain. Each flush
appends one entry; once the cap is hit, the oldest entry is dropped
from the in-memory manifest before the new one is added, so the
retained set is always the most-recent N. Defaults to
[DEFAULT_MAX_SNAPSHOTS] (256). Set to 0 to disable the cap and
retain every snapshot forever (the pre-v0.3 behavior).
Pages referenced only by pruned snapshots stay on disk until the
next Mnemo::compact_file, which reclaims them. Point-in-time
recovery via Mnemo::restore_to into a pruned txn_id returns
MnemoError::NotFound.
Apply to an already-open database with Mnemo::set_max_snapshots.
Trait Implementations§
Source§impl Clone for MnemoConfig
impl Clone for MnemoConfig
Source§fn clone(&self) -> MnemoConfig
fn clone(&self) -> MnemoConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more