pub struct FsWatchPool { /* private fields */ }Implementations§
Source§impl FsWatchPool
impl FsWatchPool
Sourcepub fn new() -> Arc<Self> ⓘ
pub fn new() -> Arc<Self> ⓘ
Construct the pool and start its background event-bridging and
health-sweep tasks. Always succeeds — if even the PollWatcher
fallback fails to construct (practically never happens; it’s pure
userspace polling), the pool still comes up with watcher: None and
every subscribe call fails cleanly into degraded_paths rather than
panicking or requiring every caller to handle an Option<Arc<Self>>
at the top level. Live-update is additive everywhere it’s used.
Sourcepub fn subscribe_file(self: &Arc<Self>, path: &Path) -> Subscription
pub fn subscribe_file(self: &Arc<Self>, path: &Path) -> Subscription
Watch the file at path (specifically: its parent directory,
non-recursively — see module doc). Returns a fresh Subscription
even when the underlying OS watch is currently failing (tracked in
degraded_paths instead) — a degraded subscription still becomes
live automatically once retry/sweep succeeds, with no action needed
from the caller.
Sourcepub fn subscribe_dir(self: &Arc<Self>, path: &Path) -> Subscription
pub fn subscribe_dir(self: &Arc<Self>, path: &Path) -> Subscription
Watch the directory at path directly (non-recursive — matching
media_file_watcher.rs’s existing behavior; extension/content
filtering is the caller’s concern, not the pool’s).
Sourcepub fn subscribe_dir_recursive(self: &Arc<Self>, path: &Path) -> Subscription
pub fn subscribe_dir_recursive(self: &Arc<Self>, path: &Path) -> Subscription
Watch path and everything under it (widget packages: an edit deep in
a package folder reloads it).
Sourcepub fn unsubscribe(&self, sub: Subscription)
pub fn unsubscribe(&self, sub: Subscription)
Stop watching on behalf of sub. Idempotent-safe: unsubscribing the
same handle twice would underflow the refcount, so this takes self
by shared ref but sub by value specifically to discourage reuse —
callers that need multiple independent subscriptions to the same
path should call subscribe_file/subscribe_dir once per logical
subscriber, matching how editor_file_watcher.rs already tracks one
entry per block_id today.
Sourcepub fn events(&self) -> Receiver<FsWatchEvent>
pub fn events(&self) -> Receiver<FsWatchEvent>
Raw change events for every currently-watched target, pool-wide.
Each call returns an independent receiver — subscribe to this once
per domain module (not once per file), and filter down to the paths
that module actually cares about, same as today’s per-watcher
Inner.watched_paths filtering.
pub fn health(&self) -> FsWatchHealth
Auto Trait Implementations§
impl !Freeze for FsWatchPool
impl !RefUnwindSafe for FsWatchPool
impl !UnwindSafe for FsWatchPool
impl Send for FsWatchPool
impl Sync for FsWatchPool
impl Unpin for FsWatchPool
impl UnsafeUnpin for FsWatchPool
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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