pub enum WorldError {
Archetype(ArchetypeError),
ReachedEntityIdCapacity,
ReachedArchetypeIdCapacity,
EntityDoesNotExists {
entity: Entity,
},
ArchetypeDoesNotExists {
id: u32,
},
DuplicateMutableArchetypeAccess {
id: u32,
},
EmptyColumnSet,
}Expand description
Represents errors that can occur in the ECS World.
Variants§
Archetype(ArchetypeError)
Error related to an archetype operation.
ReachedEntityIdCapacity
Indicates that the system has reached the maximum capacity for entity IDs.
ReachedArchetypeIdCapacity
Indicates that the system has reached the maximum capacity for archetype IDs.
EntityDoesNotExists
Indicates that an operation was attempted on an entity that does not exist.
ArchetypeDoesNotExists
Indicates that an operation was attempted on an archetype that does not exist.
DuplicateMutableArchetypeAccess
Indicates an attempt to access the same archetype mutably more than once, which could lead to data race issues.
EmptyColumnSet
Indicates that an operation involved an empty column set, which is invalid in the ECS context.
Implementations§
Source§impl WorldError
impl WorldError
Sourcepub fn allow<T>(
input: Result<T, Self>,
items: impl IntoIterator<Item = Self>,
ok: T,
) -> Result<T, Self>
pub fn allow<T>( input: Result<T, Self>, items: impl IntoIterator<Item = Self>, ok: T, ) -> Result<T, Self>
Allows certain errors to be ignored by providing a fallback value (ok).
This method checks whether the error matches any of the allowed error variants
provided in items. If a match is found, the provided fallback value (ok) is
returned instead. Otherwise, the original error is returned.
§Arguments
input- AResultthat may contain an error to evaluate.items- A collection ofWorldErrorvariants to allow.ok- The value to return if the error matches one of the allowed variants.
§Returns
Ok(ok)if the error matches an allowed variant.Err(error)if the error does not match any allowed variant.
Trait Implementations§
Source§impl Debug for WorldError
impl Debug for WorldError
Source§impl Display for WorldError
impl Display for WorldError
Source§impl Error for WorldError
impl Error for WorldError
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
Source§impl From<ArchetypeError> for WorldError
impl From<ArchetypeError> for WorldError
Source§fn from(value: ArchetypeError) -> Self
fn from(value: ArchetypeError) -> Self
Source§impl From<WorldError> for PrefabError
impl From<WorldError> for PrefabError
Source§fn from(value: WorldError) -> Self
fn from(value: WorldError) -> Self
Source§impl PartialEq for WorldError
impl PartialEq for WorldError
impl Eq for WorldError
impl StructuralPartialEq for WorldError
Auto Trait Implementations§
impl Freeze for WorldError
impl RefUnwindSafe for WorldError
impl Send for WorldError
impl Sync for WorldError
impl Unpin for WorldError
impl UnwindSafe for WorldError
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.