pub enum EmbeddingError {
Parse {
source: String,
message: String,
position: Option<usize>,
},
UnresolvedPlaceholder {
name: String,
source: String,
},
LifecycleMismatch {
source: String,
dynamic_inputs: Vec<String>,
},
UnknownNode {
name: String,
source: String,
suggestion: Option<String>,
},
TypeMismatch {
from_node: String,
from_type: PortType,
to_node: String,
to_type: PortType,
source: String,
},
NodeEvalPanic {
node_name: String,
message: String,
source: String,
},
ResultMissing {
output_name: String,
source: String,
},
NonePropagated {
accessor: &'static str,
source: String,
},
Timeout {
source: String,
elapsed_ms: u64,
deadline_ms: u64,
},
RegistryNotInitialised {
missing: Vec<String>,
source: String,
},
}Expand description
Typed error ontology for the embedded-evaluation surface.
Per expression_engine.md §6 Error Ontology (under
crates/polydat/docs/design/), every failure mode the embedding
surface can produce maps to one of these variants. Hosts
pattern-match on the variant to drive UX, recovery, or logging
without parsing message strings.
The embedding surfaces (eval_const_expr*, the typed surfaces,
interpolate_via_kernel) return this type; the compile_polydat*
entry points return String errors, and From<EmbeddingError> for String bridges the two.
Variants§
Parse
Text could not be parsed as polydat expression source. The lexer or parser rejected the input before any semantic analysis.
Fields
UnresolvedPlaceholder
A {name} placeholder in the text had no matching
binding in the kernel chain. Produced by
interpolate_via_kernel only.
LifecycleMismatch
The expression’s upstream cone reaches a dynamic input,
but the requested evaluation surface requires
effectively-const lifecycle. Produced by
eval_const_expr (directly or via the two-step
composition).
Fields
UnknownNode
A node mentioned in the expression is not registered in the runtime. Includes a suggested alternative when the name is close to a known node.
Fields
TypeMismatch
The expression’s wire chain has a type mismatch that auto-adapters cannot heal. Produced by the assembly pass during compilation.
Fields
NodeEvalPanic
A node’s eval panicked during scope-init evaluation.
The kernel’s catch_unwind boundary captured the
panic; the message is the panic payload’s
human-readable form.
Fields
ResultMissing
Compilation succeeded but the requested output name could not be resolved in the resulting kernel. Indicates an internal compiler issue or a mismatch between the wrapper template and the compiler’s output naming.
NonePropagated
A Value::None propagated to the expression’s output
where a concrete value was required. Produced by a
HostType::from_value conversion that meets Value::None,
or by a host’s own strict accessor (as_bool on
Value::None, etc.). See SRD-74.
Timeout
Evaluation exceeded a host-specified time budget. Currently produced only by deadline-accepting surfaces (reserved for the bulk-evaluation surface γ-9 and adapter-specific embedding paths).
Fields
RegistryNotInitialised
A node the expression references is absent from the link-time node registry. Carries the node names that could not be resolved. Not produced by any current surface.
Trait Implementations§
Source§impl Clone for EmbeddingError
impl Clone for EmbeddingError
Source§fn clone(&self) -> EmbeddingError
fn clone(&self) -> EmbeddingError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EmbeddingError
impl Debug for EmbeddingError
Source§impl Display for EmbeddingError
impl Display for EmbeddingError
Source§impl Error for EmbeddingError
impl Error for EmbeddingError
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()
Source§impl From<EmbeddingError> for String
Renders the error as its message for callers on the
Result<_, String> entry points.
impl From<EmbeddingError> for String
Renders the error as its message for callers on the
Result<_, String> entry points.
Source§fn from(e: EmbeddingError) -> String
fn from(e: EmbeddingError) -> String
Auto Trait Implementations§
impl Freeze for EmbeddingError
impl RefUnwindSafe for EmbeddingError
impl Send for EmbeddingError
impl Sync for EmbeddingError
impl Unpin for EmbeddingError
impl UnsafeUnpin for EmbeddingError
impl UnwindSafe for EmbeddingError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more