pub struct StorageConfig {
pub backend: StorageBackend,
pub data_path: PathBuf,
pub cache_size_mb: usize,
pub persistence_interval: Duration,
pub compression_enabled: bool,
pub retention_period: Duration,
pub connection_string: Option<String>,
}
Expand description
Storage configuration
Fields§
§backend: StorageBackend
Storage backend type
data_path: PathBuf
Data storage path (for file-based backends)
cache_size_mb: usize
Cache size in megabytes
persistence_interval: Duration
Persistence interval for periodic saves
compression_enabled: bool
Enable compression for stored data
retention_period: Duration
Retention period for analysis results
connection_string: Option<String>
Connection string for database backends
Implementations§
Source§impl StorageConfig
impl StorageConfig
Sourcepub fn new(backend: StorageBackend, data_path: PathBuf) -> Self
pub fn new(backend: StorageBackend, data_path: PathBuf) -> Self
Create a new storage configuration
Sourcepub fn file_based(data_path: PathBuf) -> Self
pub fn file_based(data_path: PathBuf) -> Self
Create configuration for file-based storage
Sourcepub fn with_cache_size(self, size_mb: usize) -> Self
pub fn with_cache_size(self, size_mb: usize) -> Self
Set cache size in megabytes
Sourcepub fn with_persistence_interval(self, interval: Duration) -> Self
pub fn with_persistence_interval(self, interval: Duration) -> Self
Set persistence interval
Sourcepub fn with_compression(self, enabled: bool) -> Self
pub fn with_compression(self, enabled: bool) -> Self
Enable or disable compression
Sourcepub fn with_retention_period(self, period: Duration) -> Self
pub fn with_retention_period(self, period: Duration) -> Self
Set retention period for analysis results
Trait Implementations§
Source§impl Clone for StorageConfig
impl Clone for StorageConfig
Source§fn clone(&self) -> StorageConfig
fn clone(&self) -> StorageConfig
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 StorageConfig
impl Debug for StorageConfig
Source§impl Default for StorageConfig
impl Default for StorageConfig
Source§impl<'de> Deserialize<'de> for StorageConfig
impl<'de> Deserialize<'de> for StorageConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for StorageConfig
impl RefUnwindSafe for StorageConfig
impl Send for StorageConfig
impl Sync for StorageConfig
impl Unpin for StorageConfig
impl UnwindSafe for StorageConfig
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