#[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
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: ComponentIDComponent whose borrow was violated.
held: AccessKindExisting access mode already held.
requested: AccessKindAccess mode that was requested.
InvalidQueryAccess
A query declared invalid or contradictory component access.
Fields
component_id: ComponentIDThe component whose access declaration was invalid.
reason: InvalidAccessReasonThe 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.
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: BoundaryAccessFailureWhich form the access failure took.
id: BoundaryIDThe 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
existing_boundary: BoundaryIDThe 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: ComponentIDThe 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
access: AccessKindWhether the mismatched column was read-only or writable.
component_id: ComponentIDRuntime component identifier for the mismatched column.
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.
UnknownSystemId
An explicit scheduler ordering referenced a system ID that has not been registered with the scheduler.
SelfSystemOrdering
An explicit scheduler ordering made a system depend on itself.
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).
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: ComponentIDcomponent ID of the unsupported component.
GpuInitFailed
GPU init failed.
GpuDispatchFailed
GPU dispatch failed.
GpuMissingBuffer
A required GPU buffer was missing during dispatch.
Fields
archetype_id: ArchetypeIDArchetype for which the GPU buffer was requested.
component_id: ComponentIDComponent whose GPU buffer was missing.
access: GPUAccessModeIntended 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
impl Clone for ExecutionError
Source§fn clone(&self) -> ExecutionError
fn clone(&self) -> ExecutionError
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 ExecutionError
impl Debug for ExecutionError
Source§impl Display for ExecutionError
impl Display for ExecutionError
impl Eq for ExecutionError
Source§impl Error for ExecutionError
impl Error for ExecutionError
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<ExecutionError> for ECSError
impl From<ExecutionError> for ECSError
Source§fn from(e: ExecutionError) -> Self
fn from(e: ExecutionError) -> Self
Source§impl PartialEq for ExecutionError
impl PartialEq for ExecutionError
impl StructuralPartialEq for ExecutionError
Auto Trait Implementations§
impl Freeze for ExecutionError
impl RefUnwindSafe for ExecutionError
impl Send for ExecutionError
impl Sync for ExecutionError
impl Unpin for ExecutionError
impl UnsafeUnpin for ExecutionError
impl UnwindSafe for ExecutionError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more