pub struct ConfigManager { /* private fields */ }Expand description
Configuration loader and manager
Implementations§
Source§impl ConfigManager
impl ConfigManager
Sourcepub fn load_from_yaml(&mut self, path: &Path) -> SklResult<()>
pub fn load_from_yaml(&mut self, path: &Path) -> SklResult<()>
Load configuration from YAML file
Sourcepub fn load_from_json(&mut self, path: &Path) -> SklResult<()>
pub fn load_from_json(&mut self, path: &Path) -> SklResult<()>
Load configuration from JSON file
Sourcepub fn set_config(&mut self, config: PipelineConfig) -> SklResult<()>
pub fn set_config(&mut self, config: PipelineConfig) -> SklResult<()>
Set the current configuration
Sourcepub fn get_config(&self) -> PipelineConfig
pub fn get_config(&self) -> PipelineConfig
Get the current configuration
Sourcepub fn get_value(&self, path: &str) -> Option<ConfigValue>
pub fn get_value(&self, path: &str) -> Option<ConfigValue>
Get configuration value by path
Sourcepub fn set_value(&mut self, path: &str, value: ConfigValue) -> SklResult<()>
pub fn set_value(&mut self, path: &str, value: ConfigValue) -> SklResult<()>
Set configuration value by path
Sourcepub fn enable_hot_reload(&mut self)
pub fn enable_hot_reload(&mut self)
Enable hot reloading
Sourcepub fn disable_hot_reload(&mut self)
pub fn disable_hot_reload(&mut self)
Disable hot reloading
Sourcepub fn set_environment(&mut self, environment: &str)
pub fn set_environment(&mut self, environment: &str)
Set current environment
Sourcepub fn get_environment(&self) -> &str
pub fn get_environment(&self) -> &str
Get current environment
Sourcepub fn apply_environment_overrides(&mut self) -> SklResult<()>
pub fn apply_environment_overrides(&mut self) -> SklResult<()>
Apply environment-specific overrides
Sourcepub fn export_to_yaml(&self, path: &Path) -> SklResult<()>
pub fn export_to_yaml(&self, path: &Path) -> SklResult<()>
Export configuration to YAML
Sourcepub fn export_to_json(&self, path: &Path) -> SklResult<()>
pub fn export_to_json(&self, path: &Path) -> SklResult<()>
Export configuration to JSON
Sourcepub fn add_validation_rule(&mut self, rule: ValidationRule)
pub fn add_validation_rule(&mut self, rule: ValidationRule)
Add validation rule
Sourcepub fn list_validation_rules(&self) -> &[ValidationRule]
pub fn list_validation_rules(&self) -> &[ValidationRule]
List all validation rules
Sourcepub fn create_template(&self, template_type: &str) -> SklResult<PipelineConfig>
pub fn create_template(&self, template_type: &str) -> SklResult<PipelineConfig>
Create configuration template
Sourcepub fn register_provider(
&self,
name: String,
provider: Box<dyn ConfigurationProvider>,
) -> SklResult<()>
pub fn register_provider( &self, name: String, provider: Box<dyn ConfigurationProvider>, ) -> SklResult<()>
Register a configuration provider
Sourcepub fn get_from_provider(
&self,
provider_name: &str,
config_id: &str,
) -> SklResult<PipelineConfig>
pub fn get_from_provider( &self, provider_name: &str, config_id: &str, ) -> SklResult<PipelineConfig>
Get configuration from a provider
Sourcepub fn register_template(
&self,
template: ConfigurationTemplate,
) -> SklResult<()>
pub fn register_template( &self, template: ConfigurationTemplate, ) -> SklResult<()>
Register a configuration template
Sourcepub fn create_from_template(
&self,
template_name: &str,
parameters: HashMap<String, ConfigValue>,
) -> SklResult<PipelineConfig>
pub fn create_from_template( &self, template_name: &str, parameters: HashMap<String, ConfigValue>, ) -> SklResult<PipelineConfig>
Create configuration from template
Sourcepub fn validate_advanced(
&self,
config: &PipelineConfig,
) -> SklResult<ValidationResult>
pub fn validate_advanced( &self, config: &PipelineConfig, ) -> SklResult<ValidationResult>
Validate configuration with advanced validator
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConfigManager
impl RefUnwindSafe for ConfigManager
impl Send for ConfigManager
impl Sync for ConfigManager
impl Unpin 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more