pub enum LeituraError {
Leitura(LispError),
DialetoEstrangeiro {
dialeto: CaixaDialeto,
},
Dialeto(DialetoError),
}Expand description
Why reading a manifest into a Caixa failed.
Split from ManifestError (which reports a parsed manifest that is
semantically wrong) because the two answer different questions, and the
distinction is the whole point of this type: ManifestError means “your
caixa is wrong”, LeituraError::DialetoEstrangeiro means “this file is not
a caixa”.
Variants§
Leitura(LispError)
The source is not readable as a (defcaixa …) package manifest — bad
syntax, a wrong head symbol, an unknown or mistyped slot.
#[source], not #[error(transparent)]. Transparent delegates
source() past the inner error to ITS source, which drops the
LispError off the cause chain — and feira’s
load_caixa_parse_error_preserves_underlying_lisp_error_on_chain
pins that a caller can downcast_ref::<tatara_lisp::LispError>()
through an anyhow context to read the typed payload. That pin caught
this exact regression when the variant first landed transparent.
DialetoEstrangeiro
The source IS a well-formed (defcaixa …) form, but of a different
declaration than this crate’s.
The variant that did not exist before, and whose absence is the defect.
A (defcaixa :name "x" :ecosystem :go …) used to reach the derive’s
parse_kwargs_strict and come back as an unknown-keyword rejection —
byte-identical in shape to a typo in a real manifest. Measured over the
org checkout on 2026-07-31, that shape is the MAJORITY of the corpus, so
the confusing error was also the common one.
Carrying the dialect means a consumer can branch on “not mine” without
re-parsing, and a census can count it. Every user-facing byte-string
(canonical keyword, one-line description, consuming crate) is a
projection of crate::dialeto::CaixaDialeto — the variant stores the
typed dialect and the #[error] template calls
[CaixaDialeto::palavra_canonica] /
[CaixaDialeto::descricao] / [CaixaDialeto::consumidor] on it, so
the three axes cannot silently diverge from the classification. Prior
to this closure the variant carried each accessor’s return value as a
stored &'static str snapshot alongside dialeto, and the sole
constructor at Caixa::from_lisp filled all four fields — a caller
could construct DialetoEstrangeiro { dialeto: Molde, palavra_canonica: "defcaixa", … } and every downstream consumer
(Display, ad-hoc audit, future JSON serialization) would silently
disagree with dialeto.palavra_canonica() == "defmolde". The typed
enum owns the projections; the variant only carries the axis.
Fields
dialeto: CaixaDialetoWhich declaration this actually is. Sole authoritative axis;
every user-facing projection routes through
crate::dialeto::CaixaDialeto’s typed accessors so the four
axes cannot silently disagree.
Dialeto(DialetoError)
Not a manifest declaration at all.
Implementations§
Source§impl LeituraError
impl LeituraError
Sourcepub fn dialeto_estrangeiro(dialeto: CaixaDialeto) -> Self
pub fn dialeto_estrangeiro(dialeto: CaixaDialeto) -> Self
Construct a LeituraError::DialetoEstrangeiro naming the
foreign-dialect classification the Caixa::from_lisp gate
refused a (defcaixa …) source as.
Substrate primitive every foreign-dialect emission on the
Caixa::from_lisp classification-gate surface routes through,
folding the pre-lift uniform three-line
Self::DialetoEstrangeiro { dialeto } one-field struct-literal
onto one substrate primitive matching the peer
crate::dialeto::DialetoError::cabeca_errada (38d5159)
single-slot inherent-ctor discipline on the sibling
crate::dialeto::DialetoError envelope’s { encontrado: String }
axis, and matching the peer LimitsError::unknown_byte_unit /
LimitsError::unknown_duration_unit (limits_codec_unit_only_ctors!
— 29fac09) / ManifestError::code_path_empty (94dabc8) /
BehaviorError::empty_path (0e33b37) /
UpgradeError::duplicate_from (7e52aec) /
AplicacaoError::placement_cluster_duplicate (92b1c92) single-slot
inherent-ctor discipline every sibling { <field>: <T> }
error-envelope variant on caixa-core’s error surface now carries.
The one open-coded wire-up site — Caixa::from_lisp’s
crate::dialeto::CaixaDialeto::is_molde_family branch after the
crate::dialeto::classify_form classification — opened the
uniform two-line Self::DialetoEstrangeiro { dialeto } block
against the codec-scoped dialeto: CaixaDialeto binding. Routes
through LeituraError::dialeto_estrangeiro(dialeto), byte-equal
to the pre-lift struct-literal on the same Copy-bound
crate::dialeto::CaixaDialeto fixture, so any future widening
of the diagnostic shape (a stored source-file path alongside the
classified dialect, an authoring-surface caret offset into the
top-level form, a promotion of the plain dialeto: field into a
richer projection carrying both the typed dialect and a
Vec<Suggestion> neighborhood) lands at exactly one dispatch on
the substrate primitive rather than re-inlining the struct-literal
at every foreign-dialect emission on the classification gate.
Trait Implementations§
Source§impl Debug for LeituraError
impl Debug for LeituraError
Source§impl Display for LeituraError
impl Display for LeituraError
Source§impl Error for LeituraError
impl Error for LeituraError
Source§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()