Skip to main content

LayoutError

Enum LayoutError 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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.

Fields

§node: NodeId

The type whose reference could not be followed.

§

UnsupportedForEncoding

The construct has no representation in the requested encoding.

Fields

§node: NodeId

The offending type.

§encoding: Encoding

The encoding asked for.

§reason: &'static str

Why it does not fit.

§

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.

Fields

§node: NodeId

Where the descent stopped.

§

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.

Fields

§node: NodeId

The member whose type names an enclosing type.

§

Model(AstError)

The model rejected a lookup.

Trait Implementations§

Source§

impl Clone for LayoutError

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 LayoutError

Source§

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

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

impl Display for LayoutError

Source§

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

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

impl Eq for LayoutError

Source§

impl Error for LayoutError

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<AstError> for LayoutError

Source§

fn from(error: AstError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for LayoutError

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 LayoutError

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.