Skip to main content

InputValidationError

Enum InputValidationError 

Source
#[non_exhaustive]
pub enum InputValidationError { EmptyTree, IncompatibleVersion { tree_version: IrVersion, engine_version: IrVersion, }, InvalidChildReference { parent: NodeId, child: NodeId, node_count: u32, }, MultipleParents { child: NodeId, parent_a: NodeId, parent_b: NodeId, }, SelfReference { node: NodeId, }, OrphanNode { node: NodeId, }, ResourceLimitExceeded { limit_name: &'static str, current: u64, max: u64, node_path: Vec<NodeId>, }, InvalidPageTemplate { detail: String, }, UnsupportedFeature { node_id: NodeId, feature_name: String, detail: String, }, }
Expand description

Errors produced when validating a StyledTree.

Each variant includes machine-readable context sufficient for the consumer to identify and fix the problem without guesswork.

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

EmptyTree

The tree contains no nodes.

§

IncompatibleVersion

The tree’s IR version is incompatible with this engine build.

Fields

§tree_version: IrVersion
§engine_version: IrVersion
§

InvalidChildReference

A node’s children list references a NodeId that does not exist.

Fields

§parent: NodeId
§child: NodeId
§node_count: u32
§

MultipleParents

A node appears in the children list of more than one parent, violating the tree (single-parent) invariant.

Fields

§child: NodeId
§parent_a: NodeId
§parent_b: NodeId
§

SelfReference

A node lists itself as its own child.

Fields

§node: NodeId
§

OrphanNode

A non-root node is not reachable from the root via any children chain.

Fields

§node: NodeId
§

ResourceLimitExceeded

A resource limit defined in ResourceLimits has been exceeded.

Fields

§limit_name: &'static str

Human-readable name of the limit (e.g. “node_count”, “tree_depth”).

§current: u64

The actual value encountered.

§max: u64

The configured maximum.

§node_path: Vec<NodeId>

Path from root to the node where the limit was detected. Empty if the limit is tree-global (e.g. total node count).

§

InvalidPageTemplate

The page template configuration is invalid (e.g., margins exceed page dimensions, negative margin values).

Fields

§detail: String
§

UnsupportedFeature

A feature is present in the IR but is not supported by this engine version. This is a hard error — unsupported features never produce silent fallbacks.

Fields

§node_id: NodeId

The node where the unsupported feature was encountered.

§feature_name: String

Machine-readable feature name (e.g. “math_layout”, “cmyk_color”).

§detail: String

Human-readable explanation of what is unsupported and why.

Trait Implementations§

Source§

impl Debug for InputValidationError

Source§

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

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

impl Display for InputValidationError

Source§

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

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

impl Error for InputValidationError

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

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> 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.