#[non_exhaustive]pub enum Error {
Notify(WatchError),
Vcs(Error),
Io(Error),
}Expand description
An error from setting up or running a RepoWatcher.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Notify(WatchError)
The filesystem watcher failed to start, or to register/deregister a
watched path. Opaque over the private backend — inspect it through
WatchError’s classifiers (reachable directly, or via
Error::watch_error) instead of the backend’s own error type.
Vcs(Error)
A vcs-core query (detection / snapshot / local_branches) failed —
chiefly while building the watcher (capturing the baseline state). A
re-query failure during watching is skipped and retried, not surfaced
here (see RepoWatcher).
Io(Error)
A filesystem operation failed (e.g. resolving a worktree gitlink).
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Whether this wraps a transient failure worth retrying — an
interrupted / would-block / resource-busy io/spawn failure from the
underlying vcs-core query (delegates to
vcs_core::Error::is_transient), or a baseline-snapshot timeout
(Io TimedOut, raised when the startup snapshot exceeds
requery_timeout) — a wedged repo may un-wedge, and the loop already treats
a re-query timeout as a transient skip, so build() agrees. Other Io and
Notify errors are false (a failed OS watch registration won’t fix itself
on a blind retry — classify it via WatchError and act on the cause).
Mirrors the classifier family on the other facades.
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Whether the underlying VCS binary (git/jj) wasn’t found — a setup
problem (not installed / not on PATH), surfaced while building the
watcher’s baseline. Delegates to vcs_core::Error::is_not_found.
Sourcepub fn watch_error(&self) -> Option<&WatchError>
pub fn watch_error(&self) -> Option<&WatchError>
The opaque WatchError when this is a filesystem-watch backend failure;
None for a Vcs/Io error. A stable accessor (mirroring
processkit_error) so a caller — or a language
binding — can reach the watch classifiers without matching the enum
variant by hand.
Sourcepub fn processkit_error(&self) -> Option<&Error>
pub fn processkit_error(&self) -> Option<&Error>
The structured underlying processkit::Error, if this error came from a
VCS subprocess — flattening the two-level
Vcs(vcs_core::Error::Vcs(_)) nesting so a caller (or a language
binding) can read its structured fields (program, plus code/stdout/
stderr on an Exit) without hand-walking it. None for a Notify/Io
failure or a non-subprocess vcs-core error (e.g. “not a repository”).
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()