pub trait BackendHandle: Send {
// Provided methods
fn add_dir(&self, _dir: &Path) -> bool { ... }
fn watch_outside(&self, _dir: &Path) { ... }
fn remove_dir(&self, _dir: &Path) { ... }
fn retain_dirs(&self, _keep: &dyn Fn(&Path) -> bool) { ... }
}Expand description
Registration interface a backend exposes to the reconciler so the set of watched directories tracks the set of indexed ones (inotify, where a recursive watch is a descriptor per directory and an excluded subtree would otherwise still cost them all). FSEvents/RDCW cover a tree with one object and use the no-op default, as does any unfiltered root.
Provided Methods§
Sourcefn add_dir(&self, _dir: &Path) -> bool
fn add_dir(&self, _dir: &Path) -> bool
Arm a watch on a directory about to be enumerated. false means
watch descriptors are exhausted: the caller closes the root rather
than serve a mirror with a silently stale subtree in it.
Sourcefn watch_outside(&self, _dir: &Path)
fn watch_outside(&self, _dir: &Path)
Arm a directory outside the synced tree, because it holds an
ignore source the matcher consulted. Unlike BackendHandle::add_dir
this is not covered by a recursive root watch, so every filtered
root needs it however the tree itself is watched.
Sourcefn remove_dir(&self, _dir: &Path)
fn remove_dir(&self, _dir: &Path)
Disarm a directory and everything under it — deleted, or newly excluded.
Sourcefn retain_dirs(&self, _keep: &dyn Fn(&Path) -> bool)
fn retain_dirs(&self, _keep: &dyn Fn(&Path) -> bool)
Disarm every armed directory keep rejects, after a full rescan
replaces the index wholesale.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".