#[non_exhaustive]pub enum ErrorCode {
Show 14 variants
EmptyComponents,
MissingId,
MissingComponentType,
DuplicateId,
NoRoot,
UnknownComponent,
MissingRequiredProp,
MissingField,
InvalidValue,
TypeMismatch,
UnresolvedChild,
ChildCycle,
UnresolvedBinding,
MaxDepthExceeded,
}Expand description
The complete set of semantic failures this validator reports.
Deliberately closed: these codes are the contract with callers that route on
them (a recovery loop, a renderer’s error channel), so adding one is a
breaking change. Composition-constraint failures have their own codes and
live in crate::catalog::CompositionCode.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EmptyComponents
The payload declares a surface but carries no components.
MissingId
A component has no usable id.
MissingComponentType
A component has no usable component type name.
DuplicateId
Two components share an id.
NoRoot
No component has the root id, so the renderer has nothing to draw from.
UnknownComponent
A component’s type is not defined by the surface’s catalog.
MissingRequiredProp
A property the catalog marks required is missing.
MissingField
A field the protocol requires on a message envelope is missing.
Distinct from ErrorCode::MissingRequiredProp, which is about a
component property a catalog declares: this one is fixed by the wire
format and holds whatever catalog is in play.
InvalidValue
A value has the right shape but is not one the protocol permits, such as
a version naming a protocol revision this crate does not speak.
TypeMismatch
A value is of the wrong JSON type — "3" where a number is required, or
a number where the catalog declares a string.
UnresolvedChild
A child reference names a component id that does not exist.
ChildCycle
Following child references leads back to where it started.
UnresolvedBinding
A data binding cannot resolve against the surface’s data model.
MaxDepthExceeded
Nesting runs deeper than the configured maximum.
Distinct from ErrorCode::ChildCycle: a deep tree is finite and
acyclic, it is just deeper than anything a renderer will draw, and deep
enough to threaten a recursive consumer. Covers three kinds of nesting —
the component graph, the raw JSON, and chained function calls — because
all three are model-generated and all three are unbounded without a cap.
Implementations§
Trait Implementations§
impl Copy for ErrorCode
Source§impl<'de> Deserialize<'de> for ErrorCode
impl<'de> Deserialize<'de> for ErrorCode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ErrorCode
Source§impl Ord for ErrorCode
impl Ord for ErrorCode
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for ErrorCode
impl PartialOrd for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.