pub struct Config {
pub shard_count: usize,
pub data_dir: Option<PathBuf>,
pub wal_sync: SyncPolicy,
}Expand description
Configuration for opening an embedded Database.
The default configuration sets shard_count to the number of available
hardware threads, which is a good starting point for most workloads.
Fields§
§shard_count: usizeNumber of shard worker threads to spawn.
Each shard owns an independent key-space partition and runs on its own OS thread, so this value controls both parallelism and memory partitioning.
data_dir: Option<PathBuf>Optional data directory for persistence. When set, WAL and RDB snapshots
are stored under {data_dir}/shard-{N}/. Data is recovered automatically
on startup.
wal_sync: SyncPolicyWAL sync policy (only used when data_dir is set).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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