Skip to main content

BackendHandle

Trait BackendHandle 

Source
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§

Source

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.

Source

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.

Source

fn remove_dir(&self, _dir: &Path)

Disarm a directory and everything under it — deleted, or newly excluded.

Source

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".

Implementations on Foreign Types§

Source§

impl BackendHandle for Arc<Watches>

Source§

fn add_dir(&self, dir: &Path) -> bool

Source§

fn watch_outside(&self, dir: &Path)

Source§

fn remove_dir(&self, dir: &Path)

Source§

fn retain_dirs(&self, keep: &dyn Fn(&Path) -> bool)

Implementors§