1 extern crate cfg_if; 2 3 cfg_if::cfg_if! { 4 if #[cfg(target_os = "linux")] { 5 mod inotify; 6 pub type FileWatcher = crate::file_watcher::inotify::FileWatcherImpl; 7 pub type FileWatch = crate::file_watcher::inotify::FileWatchImpl; 8 } else if #[cfg(any(target_os="darwin", target_os="dragonfly", target_os="freebsd", target_os="netbsd", target_os="openbsd"))] { 9 mod kqueue; 10 pub type FileWatcher = crate::file_watcher::kqueue::FileWatcherImpl; 11 pub type FileWatch = crate::file_watcher::kqueue::FileWatchImpl; 12 } else { 13 mod mock; 14 pub type FileWatcher = crate::file_watcher::mock::FileWatcherImpl; 15 pub type FileWatch = crate::file_watcher::mock::FileWatchImpl; 16 } 17 } 18