Skip to main content

SourceError

Enum SourceError 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Unsupported

This platform has no watch backend (or the build cannot run FFI).

§

NoRoots

No watch root was supplied.

§

RootUnavailable

A watch root does not exist or could not be resolved.

Fields

§root: PathBuf

The root as the caller supplied it.

§source: Error

The underlying resolution failure.

§

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.

Fields

§root: PathBuf

The final canonical root the spawn resolved.

§

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.

Fields

§root: PathBuf

The final canonical root whose object changed.

§

TooManyExclusions

More exclusion paths than the OS honors were supplied.

Fields

§supplied: usize

How many exclusions the configuration carried.

§

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.

Fields

§source: Error

The underlying read failure.

§

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: ProbeStage

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

Fields

§requested: Backend

The foreign selection.

§

CallbackPanic

The decode callback panicked; the stream is poisoned.

Trait Implementations§

Source§

impl Debug for SourceError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SourceError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for SourceError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<SourceError> for ReplaceRootError

Source§

fn from(source: SourceError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.