Struct Error

pub struct Error { pub kind: ErrorKind, pub paths: Vec<PathBuf> }

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, path: PathBuf) -> Self

Adds a path to the error.

fn set_paths(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.

Trait Implementations

impl Debug for Error

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

impl Display for Error

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

impl Error for Error

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

impl From<Error> for Error

fn from(err: Error) -> Self

impl From<RecvError> for Error

fn from(err: RecvError) -> Self

impl<T> From<PoisonError<T>> for Error

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

impl<T> From<SendError<T>> for Error

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

Auto Trait Implementations

impl !RefUnwindSafe for Error

impl !UnwindSafe for Error

impl Freeze for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl UnsafeUnpin for Error

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> From<T> for Error

fn from(t: T) -> T

Returns the argument unchanged.

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

fn to_string(&self) -> String

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

fn into(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<U> for Error where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

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