pub struct Config {
pub monitored: MonitoredConfig,
pub logging: LoggingConfig,
pub socket: SocketConfig,
pub cache: Option<CacheConfig>,
}Expand description
Infrastructure configuration for fsmon.
The config file lives at ~/.config/fsmon/fsmon.toml.
All path resolution is based on the original user (not root’s HOME).
Daemon (running as root via sudo) uses SUDO_UID to find the right home.
CLI (running as user) uses the user’s own HOME directly.
This file is manually edited. Only infrastructure paths go here.
Monitored path entries are stored in the separate store file (see [monitored].path).
Fields§
§monitored: MonitoredConfig§logging: LoggingConfig§socket: SocketConfig§cache: Option<CacheConfig>Implementations§
Source§impl Config
impl Config
Sourcepub fn path() -> PathBuf
pub fn path() -> PathBuf
Return the config file path: $XDG_CONFIG_HOME/fsmon/fsmon.toml
Falls back to ~/.config/fsmon/fsmon.toml.
Sourcepub fn load() -> Result<Self>
pub fn load() -> Result<Self>
Load config from file. Returns default Config if file doesn’t exist. Errors if the file exists but is invalid — file is never modified.
Sourcepub fn resolve_paths(&mut self) -> Result<()>
pub fn resolve_paths(&mut self) -> Result<()>
Expand ~ in all paths using the original user’s home directory.
Replace <UID> in socket path with the actual numeric UID.