Skip to main content

EmbeddingError

Enum EmbeddingError 

Source
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

§source: String

The source text.

§message: String

The lexer’s or parser’s message.

§position: Option<usize>

The byte offset of the error, when known.

§

UnresolvedPlaceholder

A {name} placeholder in the text had no matching binding in the kernel chain. Produced by interpolate_via_kernel only.

Fields

§name: String

The placeholder’s name.

§source: String

The source text.

§

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

§source: String

The source text.

§dynamic_inputs: Vec<String>

The dynamic inputs the cone reaches.

§

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

§name: String

The unknown node’s name.

§source: String

The source text.

§suggestion: Option<String>

A registered name close to it, if any.

§

TypeMismatch

The expression’s wire chain has a type mismatch that auto-adapters cannot heal. Produced by the assembly pass during compilation.

Fields

§from_node: String

The producing node.

§from_type: PortType

Its output type.

§to_node: String

The consuming node.

§to_type: PortType

The type its port requires.

§source: String

The source text.

§

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

§node_name: String

The node that panicked.

§message: String

The panic’s message.

§source: String

The source text.

§

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.

Fields

§output_name: String

The output the caller asked for.

§source: String

The source text.

§

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.

Fields

§accessor: &'static str

The accessor the host called.

§source: String

The source text.

§

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

§source: String

The source text.

§elapsed_ms: u64

Milliseconds spent.

§deadline_ms: u64

The budget, in milliseconds.

§

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.

Fields

§missing: Vec<String>

The node names that could not be resolved.

§source: String

The source text.

Trait Implementations§

Source§

impl Clone for EmbeddingError

Source§

fn clone(&self) -> EmbeddingError

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 EmbeddingError

Source§

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

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

impl Display for EmbeddingError

Source§

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

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

impl Error for EmbeddingError

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<EmbeddingError> for String

Renders the error as its message for callers on the Result<_, String> entry points.

Source§

fn from(e: EmbeddingError) -> String

Converts to this type from the input type.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToCompactString for T
where T: Display,

Source§

impl<T> ToLine for T
where T: Display,

Source§

fn to_line(&self) -> Line<'_>

Converts the value to a Line.
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> ToSpan for T
where T: Display,

Source§

fn to_span(&self) -> Span<'_>

Converts the value to a Span.
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> ToText for T
where T: Display,

Source§

fn to_text(&self) -> Text<'_>

Converts the value to a Text.
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more