pub struct PolicyWatcher { /* private fields */ }Expand description
A debounced filesystem watcher.
The watcher runs a background thread that calls notify’s
recommended backend. Event paths and errors are coalesced into bounded
shared state; drain with PolicyWatcher::events.
Implementations§
Source§impl PolicyWatcher
impl PolicyWatcher
Sourcepub fn events(&mut self) -> Vec<WatchEvent>
pub fn events(&mut self) -> Vec<WatchEvent>
Drain any pending events. Returns an empty vec if no events are ready (i.e. nothing changed since the last call or the debounce window hasn’t elapsed).
Sourcepub fn take_errors(&mut self) -> Vec<String>
pub fn take_errors(&mut self) -> Vec<String>
Drain newly observed runtime watcher errors. Identical errors are reported once until a successful filesystem event is observed.
Auto Trait Implementations§
impl Freeze for PolicyWatcher
impl RefUnwindSafe for PolicyWatcher
impl Send for PolicyWatcher
impl Sync for PolicyWatcher
impl Unpin for PolicyWatcher
impl UnwindSafe for PolicyWatcher
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<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