Struct Error

struct Error { ... }

Notify error type.

Errors are emitted either at creation time of a Watcher, or during the event stream. They range from kernel errors to filesystem errors to argument errors.

Errors can be general, or they can be about specific paths or subtrees. In that later case, the error's paths field will be populated.

Fields

kind: ErrorKind

Kind of the error.

paths: Vec<PathBuf>

Relevant paths to the error, if any.

Implementations

impl Error

fn add_path(self: Self, path: PathBuf) -> Self

Adds a path to the error.

fn set_paths(self: Self, paths: Vec<PathBuf>) -> Self

Replaces the paths for the error.

fn new(kind: ErrorKind) -> Self

Creates a new Error with empty paths given its kind.

fn generic(msg: &str) -> Self

Creates a new generic Error from a message.

fn io(err: Error) -> Self

Creates a new i/o Error from a stdlib io::Error.

fn io_watch(err: Error) -> Self

Similar to Error::io, but specifically handles io::ErrorKind::NotFound.

fn path_not_found() -> Self

Creates a new "path not found" error.

fn watch_not_found() -> Self

Creates a new "watch not found" error.

fn invalid_config(config: &Config) -> Self

Creates a new "invalid config" error from the given Config.

impl Debug for Error

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

impl Display for Error

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

impl Error for Error

fn cause(self: &Self) -> Option<&dyn StdError>

impl Freeze for Error

impl From for Error

fn from(err: Error) -> Self

impl From for Error

fn from(err: RecvError) -> Self

impl RefUnwindSafe for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl UnsafeUnpin for Error

impl UnwindSafe for Error

impl<T> Any for Error

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Error

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Error

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

impl<T> From for Error

fn from(err: SendError<T>) -> Self

impl<T> From for Error

fn from(err: PoisonError<T>) -> Self

impl<T> From for Error

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToString for Error

fn to_string(self: &Self) -> String

impl<T, U> Into for Error

fn into(self: Self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom for Error

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Error

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