#[non_exhaustive]pub enum EntityAccessError {
NotAlive {
entity: Entity,
},
NotVisible {
entity: Entity,
scope: Entity,
},
NotMatched {
entity: Entity,
},
NotReserved {
entity: Entity,
},
NotOwned {
entity: Entity,
scope: Entity,
},
NotMovable {
entity: Entity,
scope: Entity,
},
Scaffolding {
entity: Entity,
},
WouldCycle {
child: Entity,
parent: Entity,
},
Archetype(ArchetypeAccessError),
}Expand description
Why a lookup of, or through, an entity handle was turned down.
The handle is carried by every variant, so a caller that reports the error does not have to thread it alongside.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotAlive
No live entity has this handle: it was despawned, or it never named one.
NotVisible
The entity is alive, but out of this scope’s reach.
NotMatched
The entity is visible here, but its archetype does not satisfy the query it was looked up with.
NotReserved
The handle was not reserved, so there is no row to spawn on.
A handle from crate::World::reserve_entity can be spawned on once.
Spawning on it again, on a handle that was released, or on one that was
never reserved would leave a row nobody can reach or free.
NotOwned
The entity is alive, but this scope’s subtree does not reach it, so it is not the scope’s to remove or move.
Despawning and relinking walk the subtree, so what a scope cannot reach from inside it is also not its to change. The scope that owns the entity
- the root, for anything beside this one - is the one to ask.
NotMovable
The entity is visible here, but only the root may move or remove it.
The shared subtree is readable from every scope and rearrangeable by none but the root: a scope that reads a resource there is a borrower, not an owner.
Scaffolding
The entity is one of the tree’s two scaffolding entities.
The root and the shared scope are what the tree hangs from: they are neither counted nor queried, and they do not move or go.
WouldCycle
Moving child under parent would put a scope inside its own subtree,
which would cut the tree in two.
Fields
Archetype(ArchetypeAccessError)
The entity’s archetype could not be reached.
Trait Implementations§
Source§impl Clone for EntityAccessError
impl Clone for EntityAccessError
impl Copy for EntityAccessError
Source§impl Debug for EntityAccessError
impl Debug for EntityAccessError
Source§impl Display for EntityAccessError
impl Display for EntityAccessError
impl Eq for EntityAccessError
Source§impl Error for EntityAccessError
impl Error for EntityAccessError
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<ArchetypeAccessError> for EntityAccessError
impl From<ArchetypeAccessError> for EntityAccessError
Source§fn from(source: ArchetypeAccessError) -> Self
fn from(source: ArchetypeAccessError) -> Self
Source§impl PartialEq for EntityAccessError
impl PartialEq for EntityAccessError
impl StructuralPartialEq for EntityAccessError
Auto Trait Implementations§
impl Forget for EntityAccessError
impl Freeze for EntityAccessError
impl RefUnwindSafe for EntityAccessError
impl Send for EntityAccessError
impl Sync for EntityAccessError
impl Unpin for EntityAccessError
impl UnsafeUnpin for EntityAccessError
impl UnwindSafe for EntityAccessError
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,
impl<T> Component for Twhere
T: 'static,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.