//! Cross-platform file system notification library
//!
//! # Installation
//!
//! ```toml
//! [dependencies]
//! notify = "5.0.0-pre.2"
//! ```
//!
//! ## Serde
//!
//! Events are serialisable via [serde] if the `serde` feature is enabled:
//!
//! ```toml
//! notify = { version = "5.0.0-pre.2", features = ["serde"] }
//! ```
//!
//! [serde]: https://serde.rs
//!
//! # Examples
//!
//! ```
//! use notify::{Watcher, RecommendedWatcher, RecursiveMode, Result};
//!
//! fn main() -> Result<()> {
//! // Automatically select the best implementation for your platform.
//! let mut watcher: RecommendedWatcher = Watcher::new_immediate(|res| {
//! match res {
//! Ok(event) => println!("event: {:?}", event),
//! Err(e) => println!("watch error: {:?}", e),
//! }
//! })?;
//!
//! // Add a path to be watched. All files and directories at that path and
//! // below will be monitored for changes.
//! watcher.watch(".", RecursiveMode::Recursive)?;
//!
//! Ok(())
//! }
//! ```
//!
//! ## With precise events
//!
//! By default, Notify emits non-descript events containing only the affected path and some
//! metadata. To get richer details about _what_ the events are about, you need to enable
//! [`Config::PreciseEvents`](config/enum.Config.html#variant.PreciseEvents). The full event
//! classification is described in the [`event`](event/index.html) module documentation.
//!
//! ```
//! # use notify::{Watcher, RecommendedWatcher, RecursiveMode, Result};
//! # use std::time::Duration;
//! # fn main() -> Result<()> {
//! # // Automatically select the best implementation for your platform.
//! # let mut watcher: RecommendedWatcher = Watcher::new_immediate(|res| {
//! # match res {
//! # Ok(event) => println!("event: {:?}", event),
//! # Err(e) => println!("watch error: {:?}", e),
//! # }
//! # })?;
//!
//! # // Add a path to be watched. All files and directories at that path and
//! # // below will be monitored for changes.
//! # watcher.watch(".", RecursiveMode::Recursive)?;
//!
//! use notify::Config;
//! watcher.configure(Config::PreciseEvents(true))?;
//!
//! # Ok(())
//! # }
//!
//! ```
//!
//! ## With different configurations
//!
//! It is possible to create several watchers with different configurations or implementations that
//! all call the same event function. This can accommodate advanced behaviour or work around limits.
//!
//! ```
//! # use notify::{RecommendedWatcher, RecursiveMode, Result, Watcher};
//! #
//! # fn main() -> Result<()> {
//! fn event_fn(res: Result<notify::Event>) {
//! match res {
//! Ok(event) => println!("event: {:?}", event),
//! Err(e) => println!("watch error: {:?}", e),
//! }
//! }
//!
//! let mut watcher1: RecommendedWatcher = Watcher::new_immediate(event_fn)?;
//! let mut watcher2: RecommendedWatcher = Watcher::new_immediate(event_fn)?;
//! # watcher1.watch(".", RecursiveMode::Recursive)?;
//! # watcher2.watch(".", RecursiveMode::Recursive)?;
//! #
//! # Ok(())
//! # }
//! ```
// FIXME: `anymap` crate triggers this lint and we cannot do anything here.
pub use ;
pub use ;
pub use ;
use AsRef;
use Path;
pub use crate FsEventWatcher;
pub use crate INotifyWatcher;
pub use NullWatcher;
pub use PollWatcher;
pub use ReadDirectoryChangesWatcher;
/// The set of requirements for watcher event handling functions.
/// 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.
/// The recommended `Watcher` implementation for the current platform
pub type RecommendedWatcher = INotifyWatcher;
/// The recommended `Watcher` implementation for the current platform
pub type RecommendedWatcher = FsEventWatcher;
/// The recommended `Watcher` implementation for the current platform
pub type RecommendedWatcher = ReadDirectoryChangesWatcher;
/// The recommended `Watcher` implementation for the current platform
pub type RecommendedWatcher = PollWatcher;
/// Convenience method for creating the `RecommendedWatcher` for the current platform in
/// _immediate_ mode.
///
/// See [`Watcher::new_immediate`](trait.Watcher.html#tymethod.new_immediate).