Struct Error
pub struct Error { pub kind: ErrorKind, pub paths: Vec<PathBuf>, /* private fields */ }
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: ErrorKindKind of the error.
paths: Vec<PathBuf>Relevant paths to the error, if any.
Implementations
impl Error
fn user_data(&self) -> Option<u64>Returns the application-defined value associated with this error.
Errors returned by
crate::Watcher::watch_withcarry the value from its configuration. For a failed watch operation incrate::Watcher::update_paths, the source error carries that operation's value. Errors delivered to the event handler carry the reporting watch's value, including errors encountered while installing recursive watches.Nonemeans no value was configured or the error has no specific watch or watch operation.Some(value)does not guarantee that other watches are unaffected.fn set_user_data(self, user_data: u64) -> SelfSets
Error::user_data.fn add_path(self, path: PathBuf) -> SelfAdds a path to the error.
fn set_paths(self, paths: Vec<PathBuf>) -> SelfReplaces the paths for the error.
fn new(kind: ErrorKind) -> SelfCreates a new Error with empty paths given its kind.
fn generic(msg: &str) -> SelfCreates a new generic Error from a message.
fn io(err: Error) -> SelfCreates a new i/o Error from a stdlib
io::Error.fn io_watch(err: Error) -> SelfSimilar to
Error::io, but specifically handlesio::ErrorKind::NotFound.fn path_not_found() -> SelfCreates a new "path not found" error.
fn watch_not_found() -> SelfCreates a new "watch not found" error.
fn invalid_config(config: &Config) -> SelfCreates 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 From<UpdatePathsError> for Error
fn from(value: UpdatePathsError) -> 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