pub struct Config { /* private fields */ }Expand description
Configuration for a DurabilityLayer.
Implementations§
Source§impl Config
impl Config
Sourcepub fn new(db_path: impl Into<PathBuf>) -> Self
pub fn new(db_path: impl Into<PathBuf>) -> Self
Create a new Config for the database at db_path.
The WAL path is automatically derived as {db_path}-wal.
Use builder methods to customize additional settings.
pub fn with_poll_interval(self, interval: Duration) -> Self
pub fn with_snapshot_threshold(self, bytes: u64) -> Self
pub fn with_snapshot_interval(self, interval: Duration) -> Self
pub fn with_snapshot_check_interval(self, interval: Duration) -> Self
pub fn with_restore_behavior(self, behavior: RestoreBehavior) -> Self
pub fn with_max_frames_per_segment(self, max: u32) -> Self
pub fn with_sync_mode(self, mode: SyncMode) -> Self
pub fn with_immediate_poll_interval(self, interval: Duration) -> Self
pub fn db_path(&self) -> &PathBuf
pub fn wal_path(&self) -> &PathBuf
pub fn poll_interval(&self) -> Duration
pub fn snapshot_threshold_bytes(&self) -> u64
pub fn snapshot_interval(&self) -> Duration
pub fn snapshot_check_interval(&self) -> Duration
pub fn restore_behavior(&self) -> &RestoreBehavior
pub fn max_frames_per_segment(&self) -> u32
pub fn sync_mode(&self) -> &SyncMode
pub fn immediate_poll_interval(&self) -> Duration
pub fn health_timeout(&self) -> Duration
pub fn sync_timeout(&self) -> Duration
pub fn salt_change_timeout(&self) -> Duration
pub fn gc_interval(&self) -> Option<Duration>
pub fn max_wal_size_bytes(&self) -> u64
pub fn compaction_interval(&self) -> Option<Duration>
pub fn compaction_min_segments(&self) -> u32
Sourcepub fn with_invalid_sync_timeout(self, sync_timeout: Duration) -> Self
pub fn with_invalid_sync_timeout(self, sync_timeout: Duration) -> Self
Create a Config with all fields specified. For testing use.
Warning: This bypasses builder validation. Production code should
use Config::new() with builder methods instead.
For testing: set invalid sync_timeout.
Sourcepub fn with_invalid_health_timeout(self, health_timeout: Duration) -> Self
pub fn with_invalid_health_timeout(self, health_timeout: Duration) -> Self
For testing: set invalid health_timeout.
Sourcepub fn with_invalid_snapshot_threshold(self, bytes: u64) -> Self
pub fn with_invalid_snapshot_threshold(self, bytes: u64) -> Self
For testing: set invalid snapshot_threshold_bytes.
Sourcepub fn with_invalid_snapshot_interval(self, interval: Duration) -> Self
pub fn with_invalid_snapshot_interval(self, interval: Duration) -> Self
For testing: set invalid snapshot_interval.
Sourcepub fn with_invalid_poll_interval(self, interval: Duration) -> Self
pub fn with_invalid_poll_interval(self, interval: Duration) -> Self
For testing: set invalid poll_interval.
Sourcepub fn with_invalid_max_frames(self, max: u32) -> Self
pub fn with_invalid_max_frames(self, max: u32) -> Self
For testing: set invalid max_frames_per_segment.
Sourcepub fn with_invalid_salt_change_timeout(self, timeout: Duration) -> Self
pub fn with_invalid_salt_change_timeout(self, timeout: Duration) -> Self
For testing: set invalid salt_change_timeout.
Sourcepub fn with_invalid_snapshot_check_interval(self, interval: Duration) -> Self
pub fn with_invalid_snapshot_check_interval(self, interval: Duration) -> Self
For testing: set invalid snapshot_check_interval.
Sourcepub fn with_invalid_immediate_poll_interval(self, interval: Duration) -> Self
pub fn with_invalid_immediate_poll_interval(self, interval: Duration) -> Self
For testing: set invalid immediate_poll_interval (no clamping).
pub fn with_health_timeout(self, timeout: Duration) -> Self
pub fn with_sync_timeout(self, timeout: Duration) -> Self
pub fn with_salt_change_timeout(self, timeout: Duration) -> Self
pub fn with_gc_interval(self, interval: Option<Duration>) -> Self
pub fn with_max_wal_size_bytes(self, bytes: u64) -> Self
Sourcepub fn with_compaction_interval(self, interval: Option<Duration>) -> Self
pub fn with_compaction_interval(self, interval: Option<Duration>) -> Self
Set the compaction interval. Compaction merges multiple L0 segments into fewer L1 files for efficient restore. Set to None to disable.
Sourcepub fn with_compaction_min_segments(self, min: u32) -> Self
pub fn with_compaction_min_segments(self, min: u32) -> Self
Set the minimum number of L0 segments required to trigger compaction.
Sourcepub fn with_replica_lock_enabled(self, enabled: bool) -> Self
pub fn with_replica_lock_enabled(self, enabled: bool) -> Self
Disable the bucket replica lock (lock.json). Useful for testing with shared buckets where multiple DurabilityLayer instances share the same prefix. Default: true (lock enabled).
pub fn replica_lock_enabled(&self) -> bool
pub fn validate(&self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Forget for Config
impl Freeze for Config
impl Move 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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