Enum Error
pub enum Error {
Io {
path: PathBuf,
source: Error,
},
Pragma {
path: PathBuf,
label: String,
detail: String,
},
Drift {
path: PathBuf,
line: usize,
expected: String,
actual: String,
},
Unclassifiable {
generator: &'static str,
detail: String,
},
Manifest {
path: PathBuf,
detail: String,
},
Arm {
origin: String,
detail: String,
},
Parity(Box<ParityMismatch>),
}Expand description
Everything the generators can fail with.
Variants§
Io
A file could not be read or written.
Fields
Pragma
A page is missing one of its auto-generated pragmas, or carries it twice.
The generator writes only between the pragmas, so a page whose framing does not delimit a region has no place for the output and is an error rather than an opportunity to append one.
Fields
Drift
A page on disk does not match what the generator would write.
This is --mode check’s only failure, and the message names the file,
the first differing line and both versions of it.
Fields
Unclassifiable
A generator could not determine the truth about its input.
The fail-closed variant: an unparsable manifest, an enum variant whose message the generator cannot read, a value it has no rule for. It never degrades to a placeholder.
Fields
Manifest
examples/parity.toml does not describe the examples that exist.
Every rejection of the grammar
(docs/design/11-documentation-plan.md §17.5) lands here: a duplicate
name, a file that is named but absent, a params-only entry missing its
tolerance or reason, an unpaired entry with no reason, and — the
rule that makes silent exclusion impossible — an example file that appears
in no entry at all.
Fields
Arm
One arm of a parity pair could not be run, or printed no parity block.
Kept separate from Error::Parity because the two mean different
things: this is “the example did not produce a comparable answer”, which
is a broken example (or a missing wheel), while a mismatch is two working
examples that disagree.
Fields
Parity(Box<ParityMismatch>)
Two parity blocks disagree on a field.
Boxed because it is by far the largest variant — seven owned strings — and
an unboxed one makes every Result in this crate wide enough to trip
clippy::result_large_err on functions that can never return it.
Implementations§
§impl Error
impl Error
pub fn io(path: impl Into<PathBuf>, source: Error) -> Self
pub fn io(path: impl Into<PathBuf>, source: Error) -> Self
Wraps a filesystem error with the path it happened on.
pub fn unclassifiable(
generator: &'static str,
detail: impl Into<String>,
) -> Self
pub fn unclassifiable( generator: &'static str, detail: impl Into<String>, ) -> Self
Reports an input a generator has no rule for.
Trait Implementations§
§impl Error for Error
impl Error for Error
§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
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§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T, U> Imply<T> for U
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString]. Read more