Struct bevy::ecs::world::EntityMut[]

pub struct EntityMut<'w> { /* fields omitted */ }

Implementations

impl<'w> EntityMut<'w>

pub fn id(&self) -> Entity

pub fn location(&self) -> EntityLocation

pub fn archetype(&self) -> &Archetype

pub fn contains<T>(&self) -> bool where
    T: Component

pub fn contains_id(&self, component_id: ComponentId) -> bool

pub fn contains_type_id(&self, type_id: TypeId) -> bool

pub fn get<T>(&self) -> Option<&'w T> where
    T: Component

pub fn get_mut<T>(&mut self) -> Option<Mut<'w, T>> where
    T: Component

pub unsafe fn get_unchecked_mut<T>(&self) -> Option<Mut<'w, T>> where
    T: Component

Safety

This allows aliased mutability. You must make sure this call does not result in multiple mutable references to the same component

pub fn insert_bundle<T>(&mut self, bundle: T) -> &mut EntityMut<'w> where
    T: Bundle

pub fn remove_bundle<T>(&mut self) -> Option<T> where
    T: Bundle

pub fn remove_bundle_intersection<T>(&mut self) where
    T: Bundle

Remove any components in the bundle that the entity has.

pub fn insert<T>(&mut self, value: T) -> &mut EntityMut<'w> where
    T: Component

pub fn remove<T>(&mut self) -> Option<T> where
    T: Component

pub fn despawn(self)

pub fn world(&mut self) -> &World

pub unsafe fn world_mut(&mut self) -> &mut World

Safety

Caller must not modify the world in a way that changes the current entity’s location If the caller does do something that could change the location, self.update_location() must be called before using any other methods in EntityMut

pub fn update_location(&mut self)

Updates the internal entity location to match the current location in the internal World. This is only needed if the user called EntityMut::world, which enables the location to change.

Trait Implementations

impl<'w> BuildWorldChildren for EntityMut<'w>

Auto Trait Implementations

impl<'w> !RefUnwindSafe for EntityMut<'w>

impl<'w> Send for EntityMut<'w>

impl<'w> Sync for EntityMut<'w>

impl<'w> Unpin for EntityMut<'w>

impl<'w> !UnwindSafe for EntityMut<'w>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Component for T where
    T: 'static + Send + Sync

impl<T> Downcast for T where
    T: Any

impl<T> Downcast<T> for T

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Upcast<T> for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,