pub struct WalOptions {
pub entry_retention: Duration,
pub segments_per_retention_period: u32,
}Expand description
Configuration options for WAL behavior.
§Examples
use nano_wal::WalOptions;
use std::time::Duration;
let options = WalOptions::default()
.retention(Duration::from_secs(3600))
.segments_per_retention_period(5);Fields§
§entry_retention: DurationDuration for which entries are retained before expiration
segments_per_retention_period: u32Number of segments per retention period for rotation
Implementations§
Source§impl WalOptions
impl WalOptions
Sourcepub fn with_retention(retention: Duration) -> Self
pub fn with_retention(retention: Duration) -> Self
Creates options with custom retention duration.
§Examples
use nano_wal::WalOptions;
use std::time::Duration;
let options = WalOptions::with_retention(Duration::from_secs(3600));Sourcepub fn with_segments_per_retention_period(segments: u32) -> Self
pub fn with_segments_per_retention_period(segments: u32) -> Self
Creates options with custom segment count.
§Examples
use nano_wal::WalOptions;
let options = WalOptions::with_segments_per_retention_period(20);Sourcepub fn segments_per_retention_period(self, segments: u32) -> Self
pub fn segments_per_retention_period(self, segments: u32) -> Self
Sets segments per retention period (chainable).
Trait Implementations§
Source§impl Clone for WalOptions
impl Clone for WalOptions
Source§fn clone(&self) -> WalOptions
fn clone(&self) -> WalOptions
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 WalOptions
impl Debug for WalOptions
Auto Trait Implementations§
impl Freeze for WalOptions
impl RefUnwindSafe for WalOptions
impl Send for WalOptions
impl Sync for WalOptions
impl Unpin for WalOptions
impl UnwindSafe for WalOptions
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