pub struct World { /* private fields */ }
Implementations§
source§impl World
impl World
pub fn set_parent(&mut self, child: Entity, new_parent: Entity)
pub fn remove_parent(&mut self, child: Entity)
pub fn remove_child(&mut self, parent: Entity, child: Entity)
pub fn remove_children(&mut self, parent: Entity)
pub fn despawn_recursive(&mut self, entity: Entity)
pub fn despawn_children(&mut self, entity: Entity)
source§impl World
impl World
pub fn query<Q: WorldQuery>(&mut self) -> QueryState<Q, ()>
pub fn query_filtered<Q: WorldQuery, F: ReadOnlyWorldQuery>(
&mut self
) -> QueryState<Q, F>
source§impl World
impl World
pub fn contains_resource<T: Resource>(&self) -> bool
pub fn insert_resource<T: Resource>(&mut self, resource: T)
pub fn init_resource<T: Resource + FromWorld>(&mut self)
pub fn remove_resource<T: Resource>(&mut self) -> Option<T>
pub fn get_resource<T: Resource>(&self) -> Option<&T>
pub fn get_resource_mut<T: Resource>(&mut self) -> Option<Mut<'_, T>>
pub fn resource<T: Resource>(&self) -> &T
pub fn resource_mut<T: Resource>(&mut self) -> Mut<'_, T>
pub fn resource_or_default<T: Resource + FromWorld>(&mut self) -> Mut<'_, T>
source§impl World
impl World
pub fn spawn(&mut self) -> EntityMut<'_>
pub fn get_or_spawn(&mut self, entity: Entity) -> EntityMut<'_>
pub fn remove<T: Bundle>(&mut self, entity: Entity) -> Option<T>
pub fn get_entity(&self, entity: Entity) -> Option<EntityRef<'_>>
pub fn get_entity_mut(&mut self, entity: Entity) -> Option<EntityMut<'_>>
pub fn entity(&self, entity: Entity) -> EntityRef<'_>
pub fn entity_mut(&mut self, entity: Entity) -> EntityMut<'_>
pub fn contains<T: Component>(&self, entity: Entity) -> bool
pub fn get<T: Component>(&self, entity: Entity) -> Option<&T>
pub fn get_mut<T: Component>(&mut self, entity: Entity) -> Option<Mut<'_, T>>
pub fn despawn(&mut self, entity: Entity) -> bool
source§impl World
impl World
pub fn check_change_ticks(&mut self)
pub fn clear_trackers(&mut self)
source§impl World
impl World
pub fn increment_change_tick(&self) -> u32
pub fn change_tick(&self) -> u32
pub fn set_last_change_tick(&mut self, tick: u32)
pub fn last_change_tick(&self) -> u32
Trait Implementations§
impl Send for World
impl Sync for World
Auto Trait Implementations§
Blanket Implementations§
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read moresource§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresource§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read moresource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more