Skip to main content

EncodeError

Enum EncodeError 

Source
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.

Fields

§detail: String

What the layout crate said.

§

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.

Fields

§detail: String

The clause and what it refuses, from the planner.

§

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.

Fields

§member: String

The member.

§kind: &'static str

What kind of type it is.

§

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

§enumeration: String

The enumeration the enumerator belongs to.

§enumerator: String

The enumerator.

§detail: &'static str

Why its wire value could not be computed.

§

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.

Fields

§member: String

The member the two plans disagree about.

§detail: String

What each plan said, so the difference can be read.

Implementations§

Source§

impl EncodeError

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EncodeError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for EncodeError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for EncodeError

Source§

impl Error for EncodeError

1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<EncodeError> for RustInterfaceError

Source§

fn from(error: EncodeError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for EncodeError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for EncodeError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.