PathsMut

Trait PathsMut 

Source
pub trait PathsMut {
    // Required methods
    fn add(
        &mut self,
        path: &Path,
        recursive_mode: RecursiveMode,
    ) -> Result<(), Error>;
    fn remove(&mut self, path: &Path) -> Result<(), Error>;
    fn commit(self: Box<Self>) -> Result<(), Error>;
}
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<(), Error>

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

Source

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

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

Source

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

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§