pub struct FileWatcherService { /* private fields */ }Expand description
Service for watching configuration files on the filesystem.
This service bridges the notify crate with the ConfigWatcher infrastructure.
Implementations§
Source§impl FileWatcherService
impl FileWatcherService
Sourcepub fn new(config_watcher: SharedConfigWatcher) -> Self
pub fn new(config_watcher: SharedConfigWatcher) -> Self
Create a new file watcher service.
Sourcepub fn with_config(
config_watcher: SharedConfigWatcher,
config: FileWatcherConfig,
) -> Self
pub fn with_config( config_watcher: SharedConfigWatcher, config: FileWatcherConfig, ) -> Self
Create with custom configuration.
Sourcepub fn config_watcher(&self) -> &SharedConfigWatcher
pub fn config_watcher(&self) -> &SharedConfigWatcher
Get the configuration watcher.
Sourcepub fn config(&self) -> &FileWatcherConfig
pub fn config(&self) -> &FileWatcherConfig
Get service configuration.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the service is running.
Sourcepub fn watch(&self, source: ConfigSource) -> Result<()>
pub fn watch(&self, source: ConfigSource) -> Result<()>
Add a path to watch.
Sourcepub fn watched_paths(&self) -> Vec<PathBuf>
pub fn watched_paths(&self) -> Vec<PathBuf>
Get all watched paths.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FileWatcherService
impl !RefUnwindSafe for FileWatcherService
impl Send for FileWatcherService
impl Sync for FileWatcherService
impl Unpin for FileWatcherService
impl UnsafeUnpin for FileWatcherService
impl !UnwindSafe for FileWatcherService
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