pub enum EncodeError {
NoLayout {
detail: String,
},
SpecRefuses {
detail: String,
},
NoWriter {
member: String,
kind: &'static str,
},
NoEnumeratorValue {
enumeration: String,
enumerator: String,
detail: &'static str,
},
AmbiguousHeader {
member: String,
detail: String,
},
}Expand description
Why an encoder could not be built.
Variants§
NoLayout
The layout could not be planned, with the plan’s own reason.
SpecRefuses
The specification itself does not admit the type, in the planner’s own words and by its clause.
Kept apart from Self::NoLayout because the two answer
different questions and docs/specs/zerodds-verdicts-1.0.md
gives them different exit codes: a gap is “a tool of ours
has not written it” (exit 6, harness-gap), and this is “it was
asked and said no” (exit 1, refused). Reporting a clause of
IDL 4.2 as a gap of this tree states something about this tree
that is not true.
The distinction was a string until 2026-08-26, and twelve
generators each classified the same refusal on their own:
measured over recursive-array, ada and d answered exit 3, zig
answered 1, and twelve answered 6.
NoWriter
A member’s type has no writer.
Reported rather than skipped: a member left out of an encoder is a wire format that silently disagrees with its own plan.
NoEnumeratorValue
An enumerator’s wire value could not be computed.
Reported rather than skipped, for the same reason as
Self::NoWriter and with a sharper edge. The C encoder’s
enumeration chain initialises its holder to the declared
value and lets each arm overwrite it, so an enumerator that
reaches no arm is not absent from the stream — it is written
with the declared integer. Under
zerodds_ast_layout::EnumeratorValue::Ordinal that is a
different integer from the one every other column writes, and
nothing at run time would say so.
Fields
AmbiguousHeader
A member’s PL_CDR1 header form is not one the sample’s flag can express.
Under a per-sample
policy the header is chosen at run time, and the choice is read
by planning the type under the two policies the flag stands
between — PlCdr1HeaderPolicy::Specification and
PlCdr1HeaderPolicy::ExtendedForConstructed. A member whose
two plans differ in extended alone is one the flag decides; a
member whose two plans differ in anything else is a case where
zd_extended is not the whole of the answer, and picking one of
the two plans would write bytes nothing measured.
Implementations§
Source§impl EncodeError
impl EncodeError
Sourcepub const fn is_spec_refusal(&self) -> bool
pub const fn is_spec_refusal(&self) -> bool
Whether the specification refused the type, rather than this tree not having written a writer for it.
The one place a generator asks the question, so that sixteen of them do not each answer it from the error’s text.
Trait Implementations§
Source§impl Clone for EncodeError
impl Clone for EncodeError
Source§impl Debug for EncodeError
impl Debug for EncodeError
Source§impl Display for EncodeError
impl Display for EncodeError
impl Eq for EncodeError
Source§impl Error for EncodeError
impl Error for EncodeError
1.30.0 · 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()