pub enum EntityRef {
Worldspawn,
Entity(ErasedEntityHandle),
}Expand description
Abstraction around bevy_ecs::entity::Entity that allows us to impl Default without
world access.
Variants§
Worldspawn
The zero value for an entity reference - it is invalid to read or write fields on this type (TODO: is this true?), but it can be useful to pass it as an argument to builtins.
Entity(ErasedEntityHandle)
We use Entity rather than an index here so entities that aren’t managed by the VM
can still be passed to QuakeC functions.
Implementations§
Source§impl EntityRef
impl EntityRef
Sourcepub fn new<T: EntityHandle>(value: T) -> Self
pub fn new<T: EntityHandle>(value: T) -> Self
Create an EntityRef from a T: EntityHandle.
Sourcepub fn non_null(self) -> Result<ErasedEntityHandle>
pub fn non_null(self) -> Result<ErasedEntityHandle>
If the entity reference is not Worldspawn, return the inner entity.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EntityRef
impl RefUnwindSafe for EntityRef
impl Send for EntityRef
impl Sync for EntityRef
impl Unpin for EntityRef
impl UnsafeUnpin for EntityRef
impl UnwindSafe for EntityRef
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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 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>
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