pub struct ConfigManager;Expand description
Configuration loading and management
Handles the complex logic of loading configuration from multiple sources and merging them according to the priority hierarchy.
Implementations§
Source§impl ConfigManager
impl ConfigManager
Sourcepub fn load_config(vault_path: Option<&Path>) -> ConfigResult<ZettelConfig>
pub fn load_config(vault_path: Option<&Path>) -> ConfigResult<ZettelConfig>
Load complete configuration from all sources
This implements the configuration hierarchy by loading from multiple sources and merging them in priority order.
LOADING STRATEGY:
- Start with built-in defaults
- Override with global config file (if exists)
- Override with vault-specific config (if exists)
- Override with environment variables
- Override with command-line arguments (handled by clap)
ERROR HANDLING:
- Missing config files are not errors (use defaults)
- Invalid TOML syntax is an error with helpful context
- Validation errors include suggestions for fixes
Sourcepub fn generate_default_config() -> String
pub fn generate_default_config() -> String
Generate a default configuration file with comments
Creates a well-documented config file that users can customize. Includes explanations of each setting and examples of common configurations.
Auto Trait Implementations§
impl Freeze for ConfigManager
impl RefUnwindSafe for ConfigManager
impl Send for ConfigManager
impl Sync for ConfigManager
impl Unpin for ConfigManager
impl UnsafeUnpin for ConfigManager
impl UnwindSafe for ConfigManager
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