#[non_exhaustive]pub enum ErrorKind {
Io,
NotAgs4,
BadDictionary,
Emit,
InvalidArgument,
Other,
TypeConflict,
UnitConflict,
MissingTran,
}Expand description
What went wrong, coarsely.
#[non_exhaustive] because this list will grow: a consumer must be able to
keep compiling when it does. Match with a _ arm, or use Error::kind_str
if you are routing on the string.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io
The file could not be read, written, or found.
NotAgs4
The bytes are not AGS4 — structurally unparseable, not merely invalid.
BadDictionary
A dictionary or edition was requested that does not exist or does not parse.
Emit
The data could not be written as valid AGS4.
InvalidArgument
A caller argument was wrong — an unknown group code, a row index out of range, an encoding label nothing recognises.
Other
Something the engine reported that this crate does not classify.
Not dead weight: the engine names its error kinds as strings and is the single producer of that domain, so it can add one without this crate changing. Mapping such a token onto whichever existing kind looked closest would be a confident wrong answer; this is the honest one. It carries the engine’s own message.
TypeConflict
Two files being merged declare different AGS TYPEs for one heading, and no resolution was chosen.
Its own kind rather than ErrorKind::InvalidArgument because the
caller CAN settle it — ags4::Merge::on_type_clash
widens the column to X or promotes it to the greatest nDP precision.
The Python, Node and lat surfaces draw the same distinction under the
same type_conflict token.
UnitConflict
Two files being merged declare different UNITs for one heading.
Separate from ErrorKind::TypeConflict because it is fatal in every
mode and the two need different fixes: no resolution absorbs a unit
disagreement, since picking one would silently mislabel the other file’s
values. Reconcile the UNIT row in the sources.
MissingTran
A merge was asked to refuse when no transmission stamp is supplied
(ags4::MissingTran::Refuse) and
none was.
Its own kind rather than ErrorKind::InvalidArgument for the same
reason the two above are: it is a merge refusal, it shares their exit
code, and a caller routing on kind_str() should be able to tell which
of merge’s three refusals it hit — they need three different fixes.
Implementations§
Source§impl ErrorKind
impl ErrorKind
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The stable wire token for this kind.
Shared verbatim with the Python, Node and lat surfaces, which is what
makes it worth freezing: a tool that routes on laterite’s error strings
gets the same tokens whichever binding produced them. These strings are
part of the public API and will not change under a consumer.
Trait Implementations§
impl Copy for ErrorKind
impl Eq for ErrorKind
impl StructuralPartialEq for ErrorKind
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnsafeUnpin for ErrorKind
impl UnwindSafe for ErrorKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.