pub struct ConfigurationManager { /* private fields */ }Expand description
Configuration manager with comprehensive validation, backup, and hot-reload support
Implementations§
Source§impl ConfigurationManager
impl ConfigurationManager
Sourcepub fn NewWithSettings(
ConfigPath: Option<String>,
EnableBackup: bool,
EnvPrefix: String,
) -> Result<Self>
pub fn NewWithSettings( ConfigPath: Option<String>, EnableBackup: bool, EnvPrefix: String, ) -> Result<Self>
Create a new configuration manager with custom settings
§Arguments
ConfigPath- Optional path to configuration fileEnableBackup- Whether to enable automatic backupsEnvPrefix- Prefix for environment variable overrides
Sourcepub async fn LoadConfiguration(&self) -> Result<AirConfiguration>
pub async fn LoadConfiguration(&self) -> Result<AirConfiguration>
Load configuration from file, environment, or create default
This method implements the configuration priority chain:
- Defaults from code
- Configuration file
- Environment variables (with prefix)
§Returns
Validated and loaded configuration
Sourcepub async fn SaveConfiguration(&self, config: &AirConfiguration) -> Result<()>
pub async fn SaveConfiguration(&self, config: &AirConfiguration) -> Result<()>
Sourcepub async fn RollbackConfiguration(&self) -> Result<PathBuf>
pub async fn RollbackConfiguration(&self) -> Result<PathBuf>
Rollback configuration from the most recent backup
§Returns
Returns the path to the backup file that was restored
Sourcepub fn GetProfileDefaults(profile: &str) -> AirConfiguration
pub fn GetProfileDefaults(profile: &str) -> AirConfiguration
Sourcepub fn ExpandPath(path: &str) -> Result<PathBuf>
pub fn ExpandPath(path: &str) -> Result<PathBuf>
Sourcepub fn ComputeHash(config: &AirConfiguration) -> Result<String>
pub fn ComputeHash(config: &AirConfiguration) -> Result<String>
Sourcepub fn ExportToJson(config: &AirConfiguration) -> Result<String>
pub fn ExportToJson(config: &AirConfiguration) -> Result<String>
Sourcepub fn ImportFromJson(json_str: &str) -> Result<AirConfiguration>
pub fn ImportFromJson(json_str: &str) -> Result<AirConfiguration>
Sourcepub fn GetEnvironmentMappings(&self) -> HashMap<String, String>
pub fn GetEnvironmentMappings(&self) -> HashMap<String, String>
Get environment variable mappings
Returns a mapping of configuration paths to environment variable names
Auto Trait Implementations§
impl Freeze for ConfigurationManager
impl RefUnwindSafe for ConfigurationManager
impl Send for ConfigurationManager
impl Sync for ConfigurationManager
impl Unpin for ConfigurationManager
impl UnwindSafe for ConfigurationManager
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].