Skip to main content

ValidationError

Enum ValidationError 

Source
#[non_exhaustive]
pub enum ValidationError {
Show 20 variants InvalidWeaveId { weave_id: String, reason: &'static str, }, InvalidKnotId { knot_id: String, reason: &'static str, }, EmptyWeave { weave_id: String, }, DuplicateKnotId { knot_id: String, }, UnknownKnot { knot_id: String, }, UnknownPort { knot_id: String, port: String, expected: Vec<String>, }, WrongPortDirection { knot_id: String, port: String, expected: PortDir, actual: PortDir, }, FanIn { knot_id: String, port: String, }, Cycle { at_knot: Option<String>, }, UnconnectedRequired { knot_id: String, port: String, }, BudgetExceeded { metric: &'static str, actual: u32, limit: u32, at_knot: Option<String>, }, NumericMismatch { expected: NumericPath, actual: NumericPath, }, SignalDomainMismatch { from_knot: String, from_port: String, from_domain: SignalDomain, to_knot: String, to_port: String, to_domain: SignalDomain, }, UnresolvedSignalDomain { knot_id: String, port: String, }, InvalidParameter { knot_id: String, parameter: &'static str, reason: &'static str, }, RepresentationOverflow { what: &'static str, actual: usize, limit: usize, }, InvalidPatternId { pattern_id: String, reason: &'static str, }, DuplicateExport { export: String, }, DuplicatePatternInput { knot_id: String, port: String, first_export: String, duplicate_export: String, }, PatternInputAlreadyConnected { export: String, knot_id: String, port: String, },
}
Expand description

A graph definition is structurally invalid and cannot become a crate::Weave.

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

InvalidWeaveId

validate_def rejects an empty weave id.

Fields

§weave_id: String

Author weave id from the definition.

§reason: &'static str

Which naming rule the id violated.

§

InvalidKnotId

validate_def or Pattern::try_from rejects a knot id that breaks naming rules.

Fields

§knot_id: String

Author knot id from the definition.

§reason: &'static str

Which naming rule the id violated.

§

EmptyWeave

validate_def finds no knots in the weave definition.

Fields

§weave_id: String

Author weave id of the empty definition.

§

DuplicateKnotId

validate_def finds two knots with the same id.

Fields

§knot_id: String

Knot id that appears more than once.

§

UnknownKnot

A thread or pattern export references a knot id not present in the definition.

Fields

§knot_id: String

Knot id that could not be resolved.

§

UnknownPort

A thread or pattern export names a port that the knot kind does not declare.

Fields

§knot_id: String

Knot that owns the referenced port.

§port: String

Port name that is not in the knot catalog.

§expected: Vec<String>

Catalog port names valid for this knot kind.

§

WrongPortDirection

A referenced port exists but is used as the wrong direction (in vs out).

Fields

§knot_id: String

Knot that owns the referenced port.

§port: String

Port name used with the wrong direction.

§expected: PortDir

Direction required by the caller (thread endpoint or export check).

§actual: PortDir

Direction declared by the knot catalog for this port.

§

FanIn

Two threads target the same input port on one knot.

Fields

§knot_id: String

Knot receiving multiple sources on one input.

§port: String

Input port with more than one incoming thread.

§

Cycle

The directed thread graph contains a cycle.

Fields

§at_knot: Option<String>

One knot on the cycle, when topological sort can identify it.

§

UnconnectedRequired

A required input port has no thread and is not satisfied by a pattern export.

Fields

§knot_id: String

Knot with the dangling required input.

§port: String

Required input port left unwired.

§

BudgetExceeded

validate or validate_report exceeds a hard resource budget.

Fields

§metric: &'static str

Budget dimension that was exceeded (knots, threads, fan-out, etc.).

§actual: u32

Observed value that crossed the limit.

§limit: u32

Hard budget ceiling for this metric.

§at_knot: Option<String>

Knot where the overrun was detected, when applicable.

§

NumericMismatch

The weave’s numeric path does not match the compiled crate feature.

Fields

§expected: NumericPath

Numeric path required by the compiled build.

§actual: NumericPath

Numeric path stored on the weave definition.

§

SignalDomainMismatch

Connected ports or tied variable ports resolve to incompatible signal domains.

Fields

§from_knot: String

Source knot of the conflicting connection or port pair.

§from_port: String

Source port involved in the mismatch.

§from_domain: SignalDomain

Domain inferred or fixed on the source side.

§to_knot: String

Sink knot of the conflicting connection or port pair.

§to_port: String

Sink port involved in the mismatch.

§to_domain: SignalDomain

Domain required or inferred on the sink side.

§

UnresolvedSignalDomain

Active port domain inference could not fix a domain before validation finished.

Fields

§knot_id: String

Knot whose port domain stayed unknown.

§port: String

Port that could not be assigned a signal domain.

§

InvalidParameter

A knot kind parameter or port constraint fails catalog rules.

Fields

§knot_id: String

Knot carrying the invalid parameter value.

§parameter: &'static str

Parameter or port attribute that failed validation.

§reason: &'static str

Why the parameter value or constraint is rejected.

§

RepresentationOverflow

Knot or thread count exceeds the dense u16 representation limit.

Fields

§what: &'static str

Representation resource kind (knot or thread).

§actual: usize

Count present in the definition.

§limit: usize

Maximum storable in the dense weave representation.

§

InvalidPatternId

Pattern::try_from rejects the pattern catalog id.

Fields

§pattern_id: String

Pattern catalog id from the definition.

§reason: &'static str

Which naming rule the id violated.

§

DuplicateExport

Pattern::try_from finds two exports with the same name.

Fields

§export: String

Export name declared more than once.

§

DuplicatePatternInput

Two input exports map to the same inner physical port.

Fields

§knot_id: String

Inner knot owning the doubly exported input.

§port: String

Inner port exported under two names.

§first_export: String

First export name bound to this port.

§duplicate_export: String

Second export name bound to the same port.

§

PatternInputAlreadyConnected

An input export targets a port already wired inside the pattern.

Fields

§export: String

Export name that aliases an internally connected input.

§knot_id: String

Inner knot already receiving an internal thread on this port.

§port: String

Inner input port that is not available for external wiring.

Trait Implementations§

Source§

impl Clone for ValidationError

Source§

fn clone(&self) -> ValidationError

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 ValidationError

Source§

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

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

impl Display for ValidationError

Source§

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

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

impl Eq for ValidationError

Source§

impl Error for ValidationError

Available on crate feature std only.
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<ValidationError> for ComposeError

Source§

fn from(value: ValidationError) -> Self

Converts to this type from the input type.
Source§

impl From<ValidationError> for BuildError

Source§

fn from(value: ValidationError) -> Self

Converts to this type from the input type.
Source§

impl From<ValidationError> for RonCodecError

Source§

fn from(value: ValidationError) -> Self

Converts to this type from the input type.
Source§

impl From<ValidationError> for JsonCodecError

Source§

fn from(value: ValidationError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ValidationError

Source§

fn eq(&self, other: &ValidationError) -> 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 ValidationError

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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