ratkit 0.2.15

A comprehensive collection of reusable TUI components for ratatui including resizable splits, tree views, markdown rendering, toast notifications, dialogs, and terminal embedding
Documentation
//! Stop watching a path.

use notify::Watcher;
use std::path::Path;

use crate::services::file_watcher::FileWatcher;

impl FileWatcher {
    /// Stop watching a path.
    ///
    /// # Arguments
    ///
    /// * `path` - Path to stop watching.
    ///
    /// # Errors
    ///
    /// Returns a `notify::Error` if the path cannot be unwatched.
    ///
    /// # Example
    ///
    /// ```no_run
    /// use ratatui_toolkit::services::file_watcher::FileWatcher;
    /// use std::path::Path;
    ///
    /// let mut watcher = FileWatcher::new().unwrap();
    /// let path = Path::new("README.md");
    /// watcher.watch(path).unwrap();
    /// // Later...
    /// watcher.unwatch(path).unwrap();
    /// ```
    pub fn unwatch(&mut self, path: &Path) -> Result<(), notify::Error> {
        self.watcher.unwatch(path)
    }
}