#[non_exhaustive]pub enum SourceError {
Show 14 variants
Unsupported,
NoRoots,
RootUnavailable {
root: PathBuf,
source: Error,
},
NotADirectory {
root: PathBuf,
},
RootReplaced {
root: PathBuf,
},
TooManyExclusions {
supplied: usize,
},
ExclusionRejected,
CreateFailed,
InstanceLimit,
ReadFailed {
source: Error,
},
StartFailed,
BackendProbeFailed {
stage: ProbeStage,
},
ForeignBackend {
requested: Backend,
},
CallbackPanic,
}Expand description
Why a platform source could not start, or died.
Surfaced publicly through
WatchRootError::Source: everything after
a root is live arrives as in-band events, so this is the only backend error
shape a consumer ever sees.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unsupported
This platform has no watch backend (or the build cannot run FFI).
NoRoots
No watch root was supplied.
A watch root does not exist or could not be resolved.
NotADirectory
The FINAL canonical root is not a directory. The backend re-resolves the root at spawn, so a path retargeted to a regular file between the watcher’s own check and the pre-start barrier is caught here — a recursive stream must never be committed for a non-directory.
RootReplaced
The root OBJECT changed between the pre-start metadata capture and the
stream going live: the path kept its bytes but now names a different
(dev, ino). The just-started stream was torn down — committing it
would anchor coverage and registry identity to two different objects.
TooManyExclusions
More exclusion paths than the OS honors were supplied.
ExclusionRejected
The OS rejected the exclusion path set.
CreateFailed
The OS could not create the event stream.
InstanceLimit
The per-user watch-instance ceiling was hit (EMFILE: the process fd
limit or fs.inotify.max_user_instances — one instance per root is the
overflow-isolation trade).
ReadFailed
The stream’s read loop failed; the stream is dead.
StartFailed
The OS could not start the event stream.
BackendProbeFailed
A forced privileged backend (Backend::Fanotify, Backend::UsnJournal)
failed a precondition: the named stage was refused, or the seed walk found
the tree not fully walkable (Walk — an existing in-root directory the
map could not admit), so the backend cannot start. Backend::Auto falls
back to the unprivileged arm instead of surfacing this.
Fields
stage: ProbeStageThe precondition stage that failed.
ForeignBackend
The forced backend names another platform’s primitive, so it can never
start on this host. Backend::Auto is never foreign — the spawn
barrier resolves it to the host’s own primitive.
CallbackPanic
The decode callback panicked; the stream is poisoned.
Trait Implementations§
Source§impl Debug for SourceError
impl Debug for SourceError
Source§impl Display for SourceError
impl Display for SourceError
Source§impl Error for SourceError
impl Error for SourceError
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()