#[non_exhaustive]pub enum LayoutError {
Unresolved {
node: NodeId,
},
UnsupportedForEncoding {
node: NodeId,
encoding: Encoding,
reason: &'static str,
},
KeyMustBeBigEndian,
TooDeep {
node: NodeId,
},
RecursionOutsideCollection {
node: NodeId,
},
Model(AstError),
}Expand description
Why a layout could not be computed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unresolved
A reference in the type graph is not resolved, so the size and alignment behind it are unknown. Guessing would produce a plan that is wrong on the wire, which is worse than no plan.
UnsupportedForEncoding
The construct has no representation in the requested encoding.
Fields
KeyMustBeBigEndian
A key-holder plan was asked for in little-endian. The key holder is defined big-endian; honouring the request would produce a wrong hash. DDSI-RTPS 2.5 §9.6.3.8.
TooDeep
The type graph nests deeper than the planner will follow.
RecursionOutsideCollection
A member’s type closes a cycle with nothing on it that can terminate a value.
IDL 4.2 §7.4.1.4.4.4.4 admits a recursive structure or union
“via members that have a sequence type” — “an incomplete type
can only appear as the element type of a sequence definition” —
because the element count is what makes a value finite. A map
carries a count the same way, and an @optional member carries
the same property in the other form: the member can be absent,
and an absent member ends the value where a zero-length sequence
would. A cycle over any of the three is planned; a cycle over
none of them has no finite value at all and is refused here, by
name rather than by a depth limit that would report a number and
not a reason. An array is the case that fails it: its element
count is fixed and non-zero, so nothing about a value can stop
the descent.
XTypes 1.3 §7.3.1.2.1.4 is not a second ground for this refusal.
It refuses a cyclic value — “if the graph of objects has
cycles, it is not serializable” — and a recursive type whose
values are trees has none. That distinction is a value-time
question and is answered at value time; see
zerodds_wire_codec::MAX_VALUE_DEPTH.
Model(AstError)
The model rejected a lookup.
Trait Implementations§
Source§impl Clone for LayoutError
impl Clone for LayoutError
Source§impl Debug for LayoutError
impl Debug for LayoutError
Source§impl Display for LayoutError
impl Display for LayoutError
impl Eq for LayoutError
Source§impl Error for LayoutError
impl Error for LayoutError
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()