pub struct World { /* private fields */ }
Implementations
sourceimpl World
impl World
pub fn new() -> Self
pub fn id(&self) -> WorldId
pub fn reserve_entity(&self) -> Entity
pub fn flush(&mut self)
pub fn len(&self) -> u32
pub fn contains_entity(&self, entity: Entity) -> bool
pub fn init_component<T: Component>(&mut self) -> ComponentId
pub fn despawn(&mut self, entity: Entity) -> bool
sourceimpl 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>
sourceimpl 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 + Default>(&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>
sourceimpl World
impl World
pub fn spawn(&mut self) -> EntityMut<'_>
pub fn get_or_spawn(&mut self, entity: Entity) -> EntityMut<'_>
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<'_>
sourceimpl World
impl World
pub fn check_change_ticks(&mut self)
pub fn clear_trackers(&mut self)
sourceimpl 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
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
sourcefn 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 moresourcefn 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 moresourcefn 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 moresourcefn 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