pub struct Config {
pub window_duration: Duration,
pub sources: SourceConfig,
pub export_path: PathBuf,
pub data_path: PathBuf,
pub paused: bool,
pub session_gap_threshold_secs: u64,
}Expand description
Main configuration for the sensor agent.
Fields§
§window_duration: DurationDuration of each collection window
sources: SourceConfigWhich input sources to capture
export_path: PathBufPath for exporting HSI snapshots
data_path: PathBufPath for storing state and transparency logs
paused: boolWhether collection is currently paused
session_gap_threshold_secs: u64Gap threshold for session boundaries (in seconds)
Implementations§
Source§impl Config
impl Config
Sourcepub fn load() -> Result<Self, ConfigError>
pub fn load() -> Result<Self, ConfigError>
Load configuration from the default location.
Sourcepub fn save(&self) -> Result<(), ConfigError>
pub fn save(&self) -> Result<(), ConfigError>
Save configuration to the default location.
Sourcepub fn config_path() -> PathBuf
pub fn config_path() -> PathBuf
Get the path to the configuration file.
Sourcepub fn ensure_directories(&self) -> Result<(), ConfigError>
pub fn ensure_directories(&self) -> Result<(), ConfigError>
Ensure all required directories exist.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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 Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin 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
Mutably borrows from an owned value. Read more