#[derive(Debug, Clone)]
pub struct SnapshotConfig {
pub max_snapshots: usize,
pub enable_compression: bool,
pub builtin_warmup: bool,
pub version: String,
pub enable_lazy_loading: bool,
pub snapshot_dir: Option<String>,
}
impl Default for SnapshotConfig {
fn default() -> Self {
Self {
max_snapshots: 3,
enable_compression: false,
builtin_warmup: true,
version: format!("v{}", env!("CARGO_PKG_VERSION")),
enable_lazy_loading: true,
snapshot_dir: None,
}
}
}
impl SnapshotConfig {
pub fn new() -> Self {
Self::default()
}
pub fn with_max_snapshots(mut self, max: usize) -> Self {
self.max_snapshots = max;
self
}
pub fn with_compression(mut self, enabled: bool) -> Self {
self.enable_compression = enabled;
self
}
pub fn with_builtin_warmup(mut self, enabled: bool) -> Self {
self.builtin_warmup = enabled;
self
}
pub fn with_snapshot_dir(mut self, dir: String) -> Self {
self.snapshot_dir = Some(dir);
self
}
}