pub struct RuntimeConfigManager { /* private fields */ }Expand description
Runtime configuration manager.
Provides thread-safe runtime configuration updates with validation and event notification.
Implementations§
Source§impl RuntimeConfigManager
impl RuntimeConfigManager
Sourcepub fn with_state(state: RuntimeState) -> Self
pub fn with_state(state: RuntimeState) -> Self
Create a manager with initial state.
Sourcepub fn set_update_callback<F>(&self, callback: F)
pub fn set_update_callback<F>(&self, callback: F)
Set the callback for applying updates.
Sourcepub fn state(&self) -> RuntimeState
pub fn state(&self) -> RuntimeState
Get the current configuration state.
Sourcepub fn state_lock(&self) -> &Arc<RwLock<RuntimeState>>
pub fn state_lock(&self) -> &Arc<RwLock<RuntimeState>>
Get a reference to the state lock.
Sourcepub fn subscribe(&self) -> Receiver<ConfigEvent>
pub fn subscribe(&self) -> Receiver<ConfigEvent>
Subscribe to configuration events.
Sourcepub fn apply(&self, update: ConfigUpdate) -> Result<()>
pub fn apply(&self, update: ConfigUpdate) -> Result<()>
Apply a single configuration update.
Sourcepub fn apply_batch(&self, updates: Vec<ConfigUpdate>) -> Result<()>
pub fn apply_batch(&self, updates: Vec<ConfigUpdate>) -> Result<()>
Apply multiple updates atomically.
Sourcepub fn get<T: FromRuntimeState>(&self) -> T
pub fn get<T: FromRuntimeState>(&self) -> T
Get a specific setting value.
Sourcepub fn export_json(&self) -> Result<String>
pub fn export_json(&self) -> Result<String>
Export current state as JSON.
Sourcepub fn import_json(&self, json: &str) -> Result<()>
pub fn import_json(&self, json: &str) -> Result<()>
Import state from JSON.
Trait Implementations§
Source§impl Debug for RuntimeConfigManager
impl Debug for RuntimeConfigManager
Auto Trait Implementations§
impl !Freeze for RuntimeConfigManager
impl !RefUnwindSafe for RuntimeConfigManager
impl Send for RuntimeConfigManager
impl Sync for RuntimeConfigManager
impl Unpin for RuntimeConfigManager
impl UnsafeUnpin for RuntimeConfigManager
impl !UnwindSafe for RuntimeConfigManager
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