notify_forked/
null.rs

1//! Stub Watcher implementation
2
3#![allow(unused_variables)]
4
5use super::{DebouncedEvent, RawEvent, RecursiveMode, Result, Watcher};
6use std::path::Path;
7use std::sync::mpsc::Sender;
8use std::time::Duration;
9
10/// Stub `Watcher` implementation
11///
12/// Events are never delivered from this watcher.
13pub struct NullWatcher;
14
15impl Watcher for NullWatcher {
16    fn new_raw(tx: Sender<RawEvent>) -> Result<NullWatcher> {
17        Ok(NullWatcher)
18    }
19
20    fn new(tx: Sender<DebouncedEvent>, delay: Duration) -> Result<NullWatcher> {
21        Ok(NullWatcher)
22    }
23
24    fn watch<P: AsRef<Path>>(&mut self, path: P, recursive_mode: RecursiveMode) -> Result<()> {
25        Ok(())
26    }
27
28    fn unwatch<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {
29        Ok(())
30    }
31}