Skip to main content

ExecutionError

Enum ExecutionError 

Source
#[non_exhaustive]
pub enum ExecutionError {
Show 22 variants StructuralMutationDuringIteration, BorrowConflict { component_id: ComponentID, held: AccessKind, requested: AccessKind, }, InvalidQueryAccess { component_id: ComponentID, reason: InvalidAccessReason, }, SelfChannelAlias { channel_id: ChannelID, }, BoundaryAccessFailed { reason: BoundaryAccessFailure, id: BoundaryID, }, DuplicateChannelRegistration { channel_id: ChannelID, existing_boundary: BoundaryID, }, ChannelIdOverflow, MissingComponent { component_id: ComponentID, }, QueryTypeMismatch { method: &'static str, access: AccessKind, index: usize, component_id: ComponentID, expected: &'static str, actual: &'static str, }, DuplicateSystemId { system_id: SystemID, }, UnknownSystemId { system_id: SystemID, }, SelfSystemOrdering { system_id: SystemID, }, SchedulerInvariantViolation, SchedulerCycle, LockPoisoned { what: &'static str, }, GpuNotEnabled, GpuUnsupportedComponent { component_id: ComponentID, name: &'static str, }, GpuInitFailed { message: Cow<'static, str>, }, GpuDispatchFailed { message: Cow<'static, str>, }, GpuMissingBuffer { archetype_id: ArchetypeID, component_id: ComponentID, access: GPUAccessMode, }, InternalExecutionError, SystemRuntime(String),
}
Expand description

Errors that occur during ECS execution and iteration.

These errors represent violations of ECS runtime safety rules detected dynamically by the engine.

§Characteristics

  • Caused by incorrect API usage
  • Always deterministic
  • Never indicate partial ECS mutation

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

StructuralMutationDuringIteration

Attempted to mutate ECS structure while iteration was active.

This includes spawning, despawning, adding/removing components, or calling with_exclusive during iteration.

§

BorrowConflict

Component borrow rules were violated at runtime.

Fields

§component_id: ComponentID

Component whose borrow was violated.

§held: AccessKind

Existing access mode already held.

§requested: AccessKind

Access mode that was requested.

§

InvalidQueryAccess

A query declared invalid or contradictory component access.

Fields

§component_id: ComponentID

The component whose access declaration was invalid.

§reason: InvalidAccessReason

The specific reason the access was rejected.

§

SelfChannelAlias

A system declared the same channel in both its produces and consumes sets.

This is structurally unsound: the stage packer would place the system in a stage where it both produces and consumes the channel in one pass, so the consumes observation would read un-finalised channel data. Always a bug in the system’s AccessSets declaration.

Surfaced by AccessSets::validate at system-registration time.

Fields

§channel_id: ChannelID

The channel ID that appeared in both produces and consumes.

§

BoundaryAccessFailed

An attempt to access a boundary resource via ECSReference::boundary failed because the BoundaryID was out of range or the stored resource’s concrete type did not match the requested type.

Distinct from ExecutionError::InternalExecutionError because boundary-access failures are caller-attributable: passing the wrong BoundaryID or the wrong type parameter R is a user-level bug, not an engine invariant violation.

Fields

§reason: BoundaryAccessFailure

Which form the access failure took.

§id: BoundaryID

The BoundaryID that was passed to ECSReference::boundary.

§

DuplicateChannelRegistration

Two boundary resources both declared ownership of the same ChannelID.

Channel IDs must be unique across all boundary resources so the scheduler can route finalise calls deterministically. This error is raised by ECSManager::register_boundary when the resource being registered claims a channel that is already owned by an earlier-registered resource.

Fields

§channel_id: ChannelID

The channel ID that appeared in two resources.

§existing_boundary: BoundaryID

The BoundaryID of the resource that already owned this channel.

§

ChannelIdOverflow

Channel ID allocation exhausted the u32 identifier space.

§

MissingComponent

A query attempted to access a component not present in a matched archetype.

Fields

§component_id: ComponentID

The missing component identifier.

§

QueryTypeMismatch

A typed query helper was invoked with a Rust type that does not match the component type bound into the built query.

Fields

§method: &'static str

Name of the helper that detected the mismatch.

§access: AccessKind

Whether the mismatched column was read-only or writable.

§index: usize

Column index within the query declaration order.

§component_id: ComponentID

Runtime component identifier for the mismatched column.

§expected: &'static str

Type name recorded when the query was built.

§actual: &'static str

Type name requested by the typed helper.

§

DuplicateSystemId

The scheduler was given more than one system with the same ID.

System IDs are used as stable ordering keys in the execution graph, so duplicates would make deterministic planning ambiguous.

Fields

§system_id: SystemID

The duplicated system identifier.

§

UnknownSystemId

An explicit scheduler ordering referenced a system ID that has not been registered with the scheduler.

Fields

§system_id: SystemID

The missing system identifier.

§

SelfSystemOrdering

An explicit scheduler ordering made a system depend on itself.

Fields

§system_id: SystemID

The self-dependent system identifier.

§

SchedulerInvariantViolation

Execution was aborted because the scheduler violated its declared access guarantees.

§

SchedulerCycle

The scheduler detected a dependency cycle in the combined (component-conflict + channel-ordering + explicit-ordering) partial order.

Common cycle shape: system A produces channel X and consumes channel Y; system B produces channel Y and consumes channel X. Break the cycle by removing one dependency, or restructure communication through ECS components / shared Arc<Environment> instead.

§

LockPoisoned

A synchronization primitive was poisoned (panic while held).

Fields

§what: &'static str

Description of the poisoned lock.

§

GpuNotEnabled

GPU execution requested but crate was built without --features gpu.

§

GpuUnsupportedComponent

Component used by GPU system is not registered as GPU-safe.

Fields

§component_id: ComponentID

component ID of the unsupported component.

§name: &'static str

text name of the unsupported component.

§

GpuInitFailed

GPU init failed.

Fields

§message: Cow<'static, str>

initialization failure reason.

§

GpuDispatchFailed

GPU dispatch failed.

Fields

§message: Cow<'static, str>

dispatch failure reason.

§

GpuMissingBuffer

A required GPU buffer was missing during dispatch.

Fields

§archetype_id: ArchetypeID

Archetype for which the GPU buffer was requested.

§component_id: ComponentID

Component whose GPU buffer was missing.

§access: GPUAccessMode

Intended GPU access mode for the missing buffer.

§

InternalExecutionError

Unsafe execution path was invoked incorrectly.

§

SystemRuntime(String)

A system’s runtime logic produced an error (e.g. a Python script failure). The contained string carries the formatted error message.

Trait Implementations§

Source§

impl Clone for ExecutionError

Source§

fn clone(&self) -> ExecutionError

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 ExecutionError

Source§

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

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

impl Display for ExecutionError

Source§

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

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

impl Eq for ExecutionError

Source§

impl Error for ExecutionError

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<ExecutionError> for ECSError

Source§

fn from(e: ExecutionError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ExecutionError

Source§

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

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

Source§

fn downcast(&self) -> &T

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> 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> 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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,