A comprehensive collection of reusable TUI components for ratatui including resizable splits, tree views, markdown rendering, toast notifications, dialogs, and terminal embedding
//! Drain pending events without processing.
usestd::sync::mpsc::TryRecvError;usecrate::services::file_watcher::FileWatcher;implFileWatcher{/// Drain all pending events without processing them.
////// This clears the event queue and the changed paths list,
/// useful when you want to ignore accumulated changes
/// (e.g., after a batch operation).
////// # Example
////// ```no_run
/// use ratatui_toolkit::services::file_watcher::FileWatcher;
/// use std::path::Path;
////// let mut watcher = FileWatcher::new().unwrap();
/// watcher.watch(Path::new("README.md")).unwrap();
////// // After some operation that causes many changes:
/// watcher.drain_events();
/// ```
pubfndrain_events(&mutself){loop{matchself.rx.try_recv(){Ok(_)=>continue,Err(TryRecvError::Empty)=>break,Err(TryRecvError::Disconnected)=>break,}}self.changed_paths.clear();}}