/rust/registry/src/index.crates.io-1949cf8c6b5b557f/notify-8.2.0/src/null.rs
Line | Count | Source |
1 | | //! Stub Watcher implementation |
2 | | |
3 | | #![allow(unused_variables)] |
4 | | |
5 | | use crate::Config; |
6 | | |
7 | | use super::{RecursiveMode, Result, Watcher}; |
8 | | use std::path::Path; |
9 | | |
10 | | /// Stub `Watcher` implementation |
11 | | /// |
12 | | /// Events are never delivered from this watcher. |
13 | | #[derive(Debug)] |
14 | | pub struct NullWatcher; |
15 | | |
16 | | impl Watcher for NullWatcher { |
17 | 0 | fn watch(&mut self, path: &Path, recursive_mode: RecursiveMode) -> Result<()> { |
18 | 0 | Ok(()) |
19 | 0 | } |
20 | | |
21 | 0 | fn unwatch(&mut self, path: &Path) -> Result<()> { |
22 | 0 | Ok(()) |
23 | 0 | } |
24 | | |
25 | 0 | fn new<F: crate::EventHandler>(event_handler: F, config: Config) -> Result<Self> |
26 | 0 | where |
27 | 0 | Self: Sized, |
28 | | { |
29 | 0 | Ok(NullWatcher) |
30 | 0 | } |
31 | | |
32 | 0 | fn configure(&mut self, config: Config) -> Result<bool> { |
33 | 0 | Ok(false) |
34 | 0 | } |
35 | | |
36 | 0 | fn kind() -> crate::WatcherKind { |
37 | 0 | crate::WatcherKind::NullWatcher |
38 | 0 | } |
39 | | } |