pub struct ConfigReloader { /* private fields */ }Expand description
Configuration reloader for hot-reload support
Watches configuration file for changes and notifies when reload is needed.
Implementations§
Source§impl ConfigReloader
impl ConfigReloader
Sourcepub fn new(
config_path: Arc<Path>,
current_config: AppConfig,
) -> Result<Self, Box<dyn Error>>
pub fn new( config_path: Arc<Path>, current_config: AppConfig, ) -> Result<Self, Box<dyn Error>>
Sourcepub fn check_for_changes(&mut self) -> Option<ConfigChange>
pub fn check_for_changes(&mut self) -> Option<ConfigChange>
Check for configuration changes
This method should be called periodically in the event loop.
§Returns
Returns Some(new_config) if the configuration has changed and should be reloaded,
or None if no changes were detected.
Sourcepub fn current_config(&self) -> &AppConfig
pub fn current_config(&self) -> &AppConfig
Get current configuration
Auto Trait Implementations§
impl Freeze for ConfigReloader
impl RefUnwindSafe for ConfigReloader
impl Send for ConfigReloader
impl !Sync for ConfigReloader
impl Unpin for ConfigReloader
impl UnsafeUnpin for ConfigReloader
impl UnwindSafe for ConfigReloader
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