pub struct GenericConfigManager<T>{ /* private fields */ }Expand description
Generic configuration manager providing centralized configuration management
Implementations§
Source§impl<T> GenericConfigManager<T>
impl<T> GenericConfigManager<T>
Sourcepub fn new(default_config: T) -> Self
pub fn new(default_config: T) -> Self
Creates a new configuration manager with default configuration
Sourcepub fn add_source(self, source: Arc<dyn ConfigSource>) -> Self
pub fn add_source(self, source: Arc<dyn ConfigSource>) -> Self
Adds a configuration source
Sourcepub fn add_listener(self, listener: Arc<dyn ConfigChangeListener<T>>) -> Self
pub fn add_listener(self, listener: Arc<dyn ConfigChangeListener<T>>) -> Self
Adds a configuration change listener
Sourcepub fn with_auto_reload(self, auto_reload: bool) -> Self
pub fn with_auto_reload(self, auto_reload: bool) -> Self
Enables or disables automatic configuration reloading
Sourcepub fn get_config(&self) -> Result<T, PipelineError>
pub fn get_config(&self) -> Result<T, PipelineError>
Gets the current configuration
Sourcepub async fn update_config(
&self,
new_config: T,
change_reason: String,
changed_by: String,
) -> Result<(), PipelineError>
pub async fn update_config( &self, new_config: T, change_reason: String, changed_by: String, ) -> Result<(), PipelineError>
Updates the configuration with validation
Sourcepub async fn load_from_sources(
&self,
changed_by: String,
) -> Result<(), PipelineError>
pub async fn load_from_sources( &self, changed_by: String, ) -> Result<(), PipelineError>
Loads configuration from all sources in order
Sourcepub async fn save_to_source(&self) -> Result<(), PipelineError>
pub async fn save_to_source(&self) -> Result<(), PipelineError>
Saves current configuration to the first writable source
Sourcepub fn get_change_history(&self) -> Vec<ConfigChangeEvent<T>>
pub fn get_change_history(&self) -> Vec<ConfigChangeEvent<T>>
Gets configuration change history
Sourcepub fn validate_current_config(
&self,
) -> Result<ConfigValidationResult, PipelineError>
pub fn validate_current_config( &self, ) -> Result<ConfigValidationResult, PipelineError>
Validates current configuration
Auto Trait Implementations§
impl<T> !Freeze for GenericConfigManager<T>
impl<T> !RefUnwindSafe for GenericConfigManager<T>
impl<T> Send for GenericConfigManager<T>
impl<T> Sync for GenericConfigManager<T>
impl<T> Unpin for GenericConfigManager<T>where
T: Unpin,
impl<T> !UnwindSafe for GenericConfigManager<T>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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