pub struct HotReloadConfig { /* private fields */ }
Expand description
Hot-reloadable configuration container
Implementations§
Source§impl HotReloadConfig
impl HotReloadConfig
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
Create a new hot-reloadable configuration from a file
Sourcepub fn with_poll_interval(self, interval: Duration) -> Self
pub fn with_poll_interval(self, interval: Duration) -> Self
Set the polling interval for file change detection
Sourcepub fn with_change_notifications(self) -> (Self, Receiver<ConfigChangeEvent>)
pub fn with_change_notifications(self) -> (Self, Receiver<ConfigChangeEvent>)
Enable change notifications
Sourcepub fn config(&self) -> Arc<RwLock<Config>>
pub fn config(&self) -> Arc<RwLock<Config>>
Get a thread-safe reference to the current configuration
Sourcepub fn start_watching(self) -> HotReloadHandle
pub fn start_watching(self) -> HotReloadHandle
Start automatic hot reloading in a background thread
Sourcepub fn last_modified(&self) -> SystemTime
pub fn last_modified(&self) -> SystemTime
Get the last modification time
Auto Trait Implementations§
impl Freeze for HotReloadConfig
impl RefUnwindSafe for HotReloadConfig
impl Send for HotReloadConfig
impl Sync for HotReloadConfig
impl Unpin for HotReloadConfig
impl UnwindSafe for HotReloadConfig
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