Trait PathsMut

Source
pub trait PathsMut {
    // Required methods
    fn add(&mut self, path: &Path, recursive_mode: RecursiveMode) -> Result<()>;
    fn remove(&mut self, path: &Path) -> Result<()>;
    fn commit(self: Box<Self>) -> Result<()>;
}
Expand description

Providing methods for adding and removing paths to watch.

Box<dyn PathsMut> is created by Watcher::paths_mut. See its documentation for more.

Required Methods§

Source

fn add(&mut self, path: &Path, recursive_mode: RecursiveMode) -> Result<()>

Add a new path to watch. See Watcher::watch for more.

Source

fn remove(&mut self, path: &Path) -> Result<()>

Remove a path from watching. See Watcher::unwatch for more.

Source

fn commit(self: Box<Self>) -> Result<()>

Ensure added/removed paths are applied.

The behaviour of dropping a PathsMut without calling [commit] is unspecified. The implementation is free to ignore the changes or not, and may leave the watcher in a started or stopped state.

Implementors§