Skip to main content

configbuilder_pattern_loader/
loader_ops.rs

1use crate::{ConfigError, RawFeature};
2
3/// Type-erased view of a config source used internally by [`crate::DefaultLoader`].
4///
5/// Non-generic so it can be boxed as a trait object. All deserialization of
6/// the returned `toml::Value` is performed by the caller.
7pub trait LoaderOps: Send + Sync {
8    /// Load the raw merged TOML value at `key` from all configured directories.
9    fn load_section_value(&self, key: &str) -> Result<toml::Value, ConfigError>;
10
11    /// Validate all configured directories.
12    fn validate_dirs(&self) -> Result<(), ConfigError>;
13
14    /// Load the raw feature data for `key`.
15    fn load_feature_raw(&self, key: &str) -> Result<RawFeature, ConfigError>;
16}