#[non_exhaustive]pub enum Error {
Incomplete {
field: String,
context: ErrorContext,
},
Io(Error),
ParseLine {
context: ErrorContext,
},
UnknownVariable {
variable: String,
context: ErrorContext,
},
ParseInt {
source: ParseIntError,
context: ErrorContext,
},
Duplicate {
variable: String,
context: ErrorContext,
},
Parse {
message: String,
context: ErrorContext,
},
}Expand description
Error type for pkg_summary(5) parsing operations.
Each error variant includes an ErrorContext with span information that
can be used with error reporting libraries like ariadne or miette.
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.
Incomplete
The summary is incomplete due to a missing required field.
Fields
§
context: ErrorContextLocation context for this error.
Io(Error)
An underlying I/O error.
ParseLine
The supplied line is not in the correct VARIABLE=VALUE format.
Fields
§
context: ErrorContextLocation context for this error.
UnknownVariable
The supplied variable is not a valid pkg_summary(5) variable.
Fields
§
context: ErrorContextLocation context for this error.
ParseInt
Parsing a supplied value as an Integer type failed.
Fields
§
source: ParseIntErrorThe underlying parse error.
§
context: ErrorContextLocation context for this error.
Duplicate
A duplicate value was found for a single-value field.
Fields
§
context: ErrorContextLocation context for this error.
Parse
A generic parse error from the kv module.
Implementations§
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()
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