pub struct ConfigManager { /* private fields */ }
Implementations§
Source§impl ConfigManager
impl ConfigManager
pub fn new() -> Self
pub fn with_config_file<P: AsRef<Path>>(config_path: P) -> Self
pub fn add_file_layer<P: AsRef<Path>>( &mut self, name: impl Into<String>, path: P, priority: u32, hot_reload: bool, ) -> Result<()>
pub fn add_env_layer( &mut self, name: impl Into<String>, prefix: impl Into<String>, priority: u32, )
pub fn add_memory_layer( &mut self, name: impl Into<String>, data: Value, priority: u32, )
pub fn set_event_bus(&mut self, event_bus: Arc<EventBusManager>)
pub async fn set<T>(&self, key: &str, value: T) -> Result<()>where
T: Serialize,
pub async fn get<T>(&self, key: &str) -> Result<T>where
T: for<'de> Deserialize<'de>,
pub async fn get_config(&self) -> AppConfig
pub fn subscribe_to_changes(&self) -> Receiver<ConfigChangeEvent>
pub async fn reload(&self) -> Result<()>
pub async fn validate(&self) -> Result<Vec<ValidationError>>
pub async fn debug_config(&self) -> Value
pub fn get_metadata(&self) -> Value
Trait Implementations§
Source§impl Debug for ConfigManager
impl Debug for ConfigManager
Source§impl Default for ConfigManager
impl Default for ConfigManager
Source§impl Manager for ConfigManager
Conditional Manager implementation for ConfigManager
impl Manager for ConfigManager
Conditional Manager implementation for ConfigManager
Source§fn initialize<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn initialize<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Initializes the manager
Source§fn shutdown<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Shuts down the manager
Source§fn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ManagerStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ManagerStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns current status
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HealthStatus> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = HealthStatus> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Performs health check
Source§fn pause<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn pause<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Pauses the manager
Source§fn resume<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn resume<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Resumes the manager
Source§fn restart<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn restart<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Restarts the manager
Source§fn get_config<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<Value>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn get_config<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<Value>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Gets current configuration
Source§fn update_config<'life0, 'async_trait>(
&'life0 mut self,
_config: Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn update_config<'life0, 'async_trait>(
&'life0 mut self,
_config: Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Updates configuration
Source§fn dependencies(&self) -> Vec<String>
fn dependencies(&self) -> Vec<String>
Returns dependencies
Source§fn is_essential(&self) -> bool
fn is_essential(&self) -> bool
Checks if manager is essential for system operation
Source§fn description(&self) -> Option<String>
fn description(&self) -> Option<String>
Returns manager description
Source§fn supports_runtime_reload(&self) -> bool
fn supports_runtime_reload(&self) -> bool
Checks if manager supports runtime reloading
Source§fn reload_config<'life0, 'async_trait>(
&'life0 mut self,
_config: Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn reload_config<'life0, 'async_trait>(
&'life0 mut self,
_config: Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Reloads configuration at runtime
Source§fn required_permissions(&self) -> Vec<String>
fn required_permissions(&self) -> Vec<String>
Returns required permissions
Source§fn platform_requirements(&self) -> PlatformRequirements
fn platform_requirements(&self) -> PlatformRequirements
Returns platform requirements
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
§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§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> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.