#[non_exhaustive]pub enum Error {
AlpmType(Error),
Io(&'static str, Error),
IoPath(PathBuf, &'static str, Error),
InvalidUTF8(FromUtf8Error),
NoInputFile,
ParseError(String),
SourceInfoErrors(SourceInfoErrors),
Json(Error),
}
Expand description
The high-level error that can occur when using this crate.
Notably, it contains two important enums in the context of parsing:
ParseError
is a already formatted error generated by thewinnow
parser. This effectively means that some invalid data has been encountered.SourceInfoErrors
is a list of all logical or lint errors that’re encountered in the final step. This error also contains the original file on which the errors occurred.
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.
AlpmType(Error)
ALPM type error
Io(&'static str, Error)
IO error
IoPath(PathBuf, &'static str, Error)
IO error with additional path info for more context.
InvalidUTF8(FromUtf8Error)
UTF-8 parse error when reading the input file.
NoInputFile
No input file given.
This error only occurs when running the crate::commands
functions.
ParseError(String)
A parsing error that occurred during winnow file parsing.
SourceInfoErrors(SourceInfoErrors)
A list of errors that occurred during the final SRCINFO data parsing step.
These may contain any combination of SourceInfoError
.
Json(Error)
JSON error while creating JSON formatted output.
This error only occurs when running the crate::commands
functions.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<FromUtf8Error> for Error
impl From<FromUtf8Error> for Error
Source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more