pub struct Monitor {
watch_paths: Vec<WatchPathEntry>,
background_sync_enabled: bool,
}Expand description
File monitor that coordinates watching directories and reporting events.
Fields§
§watch_paths: Vec<WatchPathEntry>Watch folders entry list configuration.
background_sync_enabled: boolState flag whether background sync is active.
Implementations§
Source§impl Monitor
impl Monitor
Sourcepub fn new(
watch_paths: Vec<WatchPathEntry>,
background_sync_enabled: bool,
) -> Self
pub fn new( watch_paths: Vec<WatchPathEntry>, background_sync_enabled: bool, ) -> Self
Initialize a new file Monitor.
Sourcepub fn start(&self, tx: Sender<MonitorEvent>) -> MonitorHandle
pub fn start(&self, tx: Sender<MonitorEvent>) -> MonitorHandle
Start the watcher thread and emit file-ready and deletion events.
Hashing is offloaded to a bounded worker pool (N = num_cpus / 2, capped at 4) so bursts of file events don’t serialise on hash latency.
Auto Trait Implementations§
impl Freeze for Monitor
impl RefUnwindSafe for Monitor
impl Send for Monitor
impl Sync for Monitor
impl Unpin for Monitor
impl UnsafeUnpin for Monitor
impl UnwindSafe for Monitor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more