Skip to main content

FileWatcherStub

Struct FileWatcherStub 

Source
pub struct FileWatcherStub { /* private fields */ }
Expand description

File watcher with debouncing, glob filtering, event batching, recursive directory watching, and dynamic watch management.

Implementations§

Source§

impl FileWatcherStub

Source

pub fn new() -> Self

Source

pub fn with_debounce(window: Duration) -> Self

Source

pub fn watch(&mut self, path: &str)

Source

pub fn watch_recursive( &mut self, path: &str, recursive: bool, ) -> Result<(), WatchError>

Source

pub fn unwatch(&mut self, path: &str)

Source

pub fn unwatch_checked(&mut self, path: &str) -> Result<(), WatchError>

Source

pub fn update_recursive( &mut self, path: &str, recursive: bool, ) -> Result<(), WatchError>

Source

pub fn replace_watches(&mut self, paths: &[&str])

Source

pub fn watch_entry(&self, path: &str) -> Option<&WatchEntry>

Source

pub fn watched_count(&self) -> usize

Source

pub fn watched_paths(&self) -> &[String]

Source

pub fn add_glob_filter(&mut self, pattern: &str) -> Result<(), WatchError>

Source

pub fn clear_glob_filters(&mut self)

Source

pub fn glob_filter_count(&self) -> usize

Source

pub fn passes_glob_filter(&self, path: &str) -> bool

Source

pub fn set_debounce_window(&mut self, window: Duration)

Source

pub fn debounce_window(&self) -> Duration

Source

pub fn inject_event(&mut self, event: FsEvent)

Source

pub fn inject_event_unfiltered(&mut self, event: FsEvent)

Source

pub fn inject_event_timed(&mut self, event: FsEvent, when: Instant)

Source

pub fn drain_events(&mut self) -> Vec<FsEvent>

Source

pub fn drain_events_debounced(&mut self) -> Vec<FsEvent>

Source

pub fn set_batching(&mut self, enabled: bool)

Source

pub fn batching_enabled(&self) -> bool

Source

pub fn set_batch_callback<F>(&mut self, cb: F)
where F: Fn(&EventBatch) + Send + Sync + 'static,

Source

pub fn clear_batch_callback(&mut self)

Source

pub fn flush_batches(&mut self) -> Vec<EventBatch>

Source

pub fn flush_batches_debounced(&mut self) -> Vec<EventBatch>

Source

pub fn batches(&self) -> &[EventBatch]

Source

pub fn clear_batches(&mut self)

Source

pub fn check_path(path: &str) -> Result<(), WatchError>

Source

pub fn path_exists(path: &str) -> bool

Trait Implementations§

Source§

impl Debug for FileWatcherStub

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for FileWatcherStub

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.