pub struct StorageLimitsConfig {
pub max_database_size: Option<u64>,
pub max_wal_size: Option<u64>,
pub safety_margin_percent: u8,
}Expand description
Configuration for database storage limits
Fields§
§max_database_size: Option<u64>Maximum database file size in bytes (None = unlimited)
max_wal_size: Option<u64>Maximum WAL file size in bytes (None = unlimited)
safety_margin_percent: u8Safety margin percentage - reject writes when this close to limit (default 5%)
Implementations§
Source§impl StorageLimitsConfig
impl StorageLimitsConfig
pub fn new() -> Self
pub fn with_max_database_size(self, size: u64) -> Self
pub fn with_max_database_size_mb(self, mb: u64) -> Self
pub fn with_max_wal_size(self, size: u64) -> Self
pub fn with_safety_margin_percent(self, percent: u8) -> Self
Sourcepub fn effective_database_limit(&self) -> Option<u64>
pub fn effective_database_limit(&self) -> Option<u64>
Calculate effective limit accounting for safety margin
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
Trait Implementations§
Source§impl Clone for StorageLimitsConfig
impl Clone for StorageLimitsConfig
Source§fn clone(&self) -> StorageLimitsConfig
fn clone(&self) -> StorageLimitsConfig
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 StorageLimitsConfig
impl Debug for StorageLimitsConfig
Auto Trait Implementations§
impl Freeze for StorageLimitsConfig
impl RefUnwindSafe for StorageLimitsConfig
impl Send for StorageLimitsConfig
impl Sync for StorageLimitsConfig
impl Unpin for StorageLimitsConfig
impl UnsafeUnpin for StorageLimitsConfig
impl UnwindSafe for StorageLimitsConfig
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