Struct PollWatcher

pub struct PollWatcher { /* private fields */ }

A Watcher that detects changes by periodically scanning paths.

Compares modification times and file sizes by default. Enable Config::with_compare_contents to also compare file contents.

Create and remove events distinguish regular files (File), directories (Folder), and other entries (Other). With Config::with_follow_symlinks enabled, symlinks are classified by their targets; otherwise they are Other. Removal events use the last observed type.

Implementations

impl PollWatcher

fn new<F: EventHandler>(event_handler: F, config: Config) -> Result<PollWatcher>

Create a new PollWatcher, configured as needed.

fn poll(&self) -> Result<()>

Actively poll for changes. Can be combined with a timeout of 0 to perform only manual polling.

fn poll_blocking(&self) -> Result<()>

Actively poll for changes and block until the poll cycle has completed.

This is primarily useful together with Config::with_manual_polling.

fn with_initial_scan<F: EventHandler, G: ScanEventHandler>(event_handler: F, config: Config, scan_callback: G) -> Result<PollWatcher>

Create a new PollWatcher with an scan event handler.

scan_fallback is called on the initial scan with all files seen by the pollwatcher.

Trait Implementations

impl Debug for PollWatcher

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Drop for PollWatcher

fn drop(&mut self)

impl Watcher for PollWatcher

fn new<F: EventHandler>(event_handler: F, config: Config) -> Result<Self>

Create a new PollWatcher.

fn watch(&mut self, path: &Path, recursive_mode: RecursiveMode) -> Result<()>
fn watch_with(&mut self, path: &Path, config: WatchPathConfig) -> Result<()>
fn unwatch(&mut self, path: &Path) -> Result<()>
fn watched_paths(&self) -> Result<Vec<WatchedPath>>
fn kind() -> WatcherKind

Auto Trait Implementations

impl Freeze for PollWatcher

impl RefUnwindSafe for PollWatcher

impl Send for PollWatcher

impl Sync for PollWatcher

impl Unpin for PollWatcher

impl UnsafeUnpin for PollWatcher

impl UnwindSafe for PollWatcher

Blanket Implementations

impl<T> Any for PollWatcher where T: 'static + ?Sized,

impl<T> Borrow<T> for PollWatcher where T: ?Sized,

impl<T> BorrowMut<T> for PollWatcher where T: ?Sized,

impl<T> From<T> for PollWatcher

impl<T, U> Into<U> for PollWatcher where U: From<T>,

impl<T, U> TryFrom<U> for PollWatcher where U: Into<T>,

impl<T, U> TryInto<U> for PollWatcher where U: TryFrom<T>,