Enum ignore::Error [−][src]
Represents an error that can occur when parsing a gitignore file.
Variants
A collection of “soft” errors. These occur when adding an ignore file partially succeeded.
An error associated with a specific line number.
An error associated with a particular file path.
An error associated with a particular directory depth when recursively walking a directory.
An error that occurs when a file loop is detected when traversing symbolic links.
Fields of Loop
Io(Error)An error that occurs when doing I/O, such as reading an ignore file.
An error that occurs when trying to parse a glob.
Fields of Glob
glob: Option<String>The original glob that caused this error. This glob, when
available, always corresponds to the glob provided by an end user.
e.g., It is the glob as written in a .gitignore file.
(This glob may be distinct from the glob that is actually
compiled, after accounting for gitignore semantics.)
err: StringThe underlying glob error as a string.
UnrecognizedFileType(String)A type selection for a file type that is not defined.
A user specified file type definition could not be parsed.
Implementations
impl Error[src]
pub fn is_partial(&self) -> bool[src]
Returns true if this is a partial error.
A partial error occurs when only some operations failed while others may have succeeded. For example, an ignore file may contain an invalid glob among otherwise valid globs.
pub fn is_io(&self) -> bool[src]
Returns true if this error is exclusively an I/O error.
pub fn io_error(&self) -> Option<&Error>[src]
Inspect the original io::Error if there is one.
None is returned if the Error doesn’t correspond to an
io::Error. This might happen, for example, when the error was
produced because a cycle was found in the directory tree while
following symbolic links.
This method returns a borrowed value that is bound to the lifetime of the Error. To
obtain an owned value, the into_io_error can be used instead.
This is the original
io::Errorand is not the same asimpl From<Error> for std::io::Errorwhich contains additional context about the error.
pub fn into_io_error(self) -> Option<Error>[src]
pub fn depth(&self) -> Option<usize>[src]
Returns a depth associated with recursively walking a directory (if this error was generated from a recursive directory iterator).
Trait Implementations
impl Clone for Error[src]
impl Debug for Error[src]
impl Display for Error[src]
impl Error for Error[src]
fn description(&self) -> &str[src]
pub fn source(&self) -> Option<&(dyn Error + 'static)>1.30.0[src]
pub fn backtrace(&self) -> Option<&Backtrace>[src]
pub fn cause(&self) -> Option<&dyn Error>1.0.0[src]
impl From<Error> for Error[src]
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,