Trait notify::Watcher [] [src]

pub trait Watcher: Sized {
    fn new(Sender<Event>) -> Result<Self>;
    fn watch<P: AsRef<Path>>(&mut self, P) -> Result<()>;
    fn unwatch<P: AsRef<Path>>(&mut self, P) -> Result<()>;
}

Type that can deliver file activity notifications

Watcher is implemented per platform using the best implementation available on that platform. In addition to such event driven implementations, a polling implementation is also provided that should work on any platform.

Required Methods

fn new(Sender<Event>) -> Result<Self>

Create a new Watcher

fn watch<P: AsRef<Path>>(&mut self, P) -> Result<()>

Begin watching a new path

If the path is a directory, events will be delivered for all files in that tree.

fn unwatch<P: AsRef<Path>>(&mut self, P) -> Result<()>

Stop watching a path

Returns an Error in the case that Path has not been watched or if failing to remove the watch fails.

Implementors