pub struct VariableFileWatcher { /* private fields */ }Expand description
File watcher for variable file changes
Implementations§
Source§impl VariableFileWatcher
impl VariableFileWatcher
Sourcepub async fn new(watch_dir: Option<PathBuf>) -> Result<Self>
pub async fn new(watch_dir: Option<PathBuf>) -> Result<Self>
Create a new variable file watcher
Sourcepub async fn register_virtual_file(
&self,
service_id: String,
vf: Arc<VirtualVariableFile>,
) -> Result<()>
pub async fn register_virtual_file( &self, service_id: String, vf: Arc<VirtualVariableFile>, ) -> Result<()>
Register a virtual file for watching
Sourcepub async fn start_watching(&self) -> Result<()>
pub async fn start_watching(&self) -> Result<()>
Start watching for changes (spawns background task)
Sourcepub async fn stop_watching(&self) -> Result<()>
pub async fn stop_watching(&self) -> Result<()>
Stop watching
Sourcepub async fn next_change(&self) -> Option<FileChangeEvent>
pub async fn next_change(&self) -> Option<FileChangeEvent>
Receive next change event (blocking)
Sourcepub async fn try_next_change(&self) -> Option<FileChangeEvent>
pub async fn try_next_change(&self) -> Option<FileChangeEvent>
Try to receive next change event (non-blocking)
Auto Trait Implementations§
impl Freeze for VariableFileWatcher
impl !RefUnwindSafe for VariableFileWatcher
impl Send for VariableFileWatcher
impl Sync for VariableFileWatcher
impl Unpin for VariableFileWatcher
impl UnsafeUnpin for VariableFileWatcher
impl !UnwindSafe for VariableFileWatcher
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