Skip to main content

TemplateError

Enum TemplateError 

Source
pub enum TemplateError {
Show 17 variants UnknownParameter { name: String, }, MissingParameter { name: String, }, DuplicateParameter { name: String, }, AliasedArgument { first: String, second: String, }, ForeignHandle { slot: CellSlot, }, InvalidActual { name: String, actual: CellId, }, TypeMismatch { name: String, expected: TypeId, found: TypeId, }, OutArgument { name: String, actual: CellId, }, EmptyRelationship, ConditionalComponent, InvalidDefinition { detail: &'static str, slot: Option<CellSlot>, }, Capacity, Factory { source: Error, slot: CellSlot, }, ConditionalFactory { source: Error, }, Construction { template: TemplateId, site: ConstructionSite, inclusions: Vec<RelationshipSlot>, source: Box<TemplateError>, }, ConditionalConstruction { template: TemplateId, conditional: usize, inclusions: Vec<RelationshipSlot>, source: Box<TemplateError>, }, Runtime(Error),
}
Expand description

Identifies a malformed recipe, binding, factory, or native graph construction.

Binding and declared-structure errors precede destination mutation. Factory-result validation, allocation and native construction failures may leave partial structure; the sheet remains safe to discard. See super::SheetTemplate::instantiate.

§Examples

See ConstructionSite’s failed-initializer example.

Variants§

§

UnknownParameter

A binding names no formal parameter.

Fields

§name: String

The unrecognized binding name.

§

MissingParameter

A formal parameter has no binding.

Fields

§name: String

The unsupplied formal name.

§

DuplicateParameter

A formal name is declared or bound more than once.

Fields

§name: String

The repeated declaration or binding name.

§

AliasedArgument

Two formals bind the same actual cell.

Fields

§first: String

The first formal bound to the actual.

§second: String

The second formal bound to the same actual.

§

ForeignHandle

A local handle belongs to another recipe.

Fields

§slot: CellSlot

The local handle from a different owner.

§

InvalidActual

An actual handle is absent from the destination.

Fields

§name: String

The formal receiving the invalid actual.

§actual: CellId

The absent live handle.

§

TypeMismatch

A binding’s concrete type differs from its formal declaration.

Fields

§name: String

The formal receiving the wrongly typed argument.

§expected: TypeId

The formal’s declared concrete type.

§found: TypeId

The actual’s registered concrete type.

§

OutArgument

An actual is a caller-owned out cell, unsupported even as an input.

Fields

§name: String

The formal receiving the out cell.

§actual: CellId

The unsupported caller-owned out cell.

§

EmptyRelationship

A relationship has no methods.

§

ConditionalComponent

A component containing private structure is used in a relationship-only site.

§

InvalidDefinition

A declaration or factory result violates the recipe’s graph contract.

Fields

§detail: &'static str

The violated recipe invariant.

§slot: Option<CellSlot>

The implicated local output, when a declaration has one.

§

Capacity

The expanded graph exceeds representable or reservable capacity.

§

Factory

A repeatable initializer or method factory failed.

Fields

§source: Error

The failed initializer or method factory.

§slot: CellSlot

The private cell or first declared method output.

§

ConditionalFactory

A conditional’s repeatable match-expression or key factory failed.

Fields

§source: Error

The underlying factory failure.

§

Construction

Retains a construction boundary and only its actual root-to-child inclusion chain.

The boxed original failure preserves concrete error downcasting. See super::SheetTemplate::instantiate.

Fields

§template: TemplateId

Identifies the failed definition.

§site: ConstructionSite

Identifies the declaration or registration that failed.

§inclusions: Vec<RelationshipSlot>

Retains active inclusion sites, ordered root to child.

§source: Box<TemplateError>

Retains the original failure without requiring Send or Sync.

§

ConditionalConstruction

Retains a failed conditional’s definition, local ordinal and active invocation sites.

Context owns identities, not recipes or live state. The original error and its typed cause remain available through std::error::Error::source. See super::SheetTemplate::instantiate.

Fields

§template: TemplateId

Identifies the definition containing the failed conditional.

§conditional: usize

Identifies the zero-based conditional registration ordinal in that definition.

§inclusions: Vec<RelationshipSlot>

Retains only active inclusion sites, ordered from the root to the failed definition.

§source: Box<TemplateError>

Retains the original concrete construction failure and its cause.

§

Runtime(Error)

An existing native graph mutator rejected construction.

Trait Implementations§

Source§

impl Debug for TemplateError

Source§

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

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

impl Display for TemplateError

Source§

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

Describes the error with its local name, handle, or underlying failure.

  • Complexity: O(L + D) for L formatted characters and D nested construction wrappers, plus underlying factory/native error formatting.
Source§

impl Error for TemplateError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the underlying factory or native construction failure.

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

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.