pub struct World { /* private fields */ }
Implementations§
Source§impl World
impl World
pub fn new() -> Self
pub fn init_resource<R>(&mut self) -> ResourceId
pub fn insert_resource<R>(&mut self, resource: R) -> ResourceIdwhere
R: Resource + 'static,
pub fn remove_resource<R>(&mut self)where
R: Resource + 'static,
pub fn get_resource<R>(&self) -> Option<&R>where
R: Resource + 'static,
pub fn get_or_init_resource<R>(&mut self) -> Option<&R>
pub fn get_resource_mut<R>(&mut self) -> Option<&mut R>where
R: Resource + 'static,
pub fn get_or_init_resource_mut<R>(&mut self) -> Option<&mut R>
pub fn spawn_entity<CL>(&mut self, components: CL) -> EntityIdwhere
CL: ComponentList,
pub fn query<CL>(&self) -> Vec<EntityId>where
CL: ComponentList,
pub fn get_entity(&self, entity_id: EntityId) -> Option<EntityRef<'_>>
pub fn get_entity_mut( &mut self, entity_id: EntityId, ) -> Option<EntityRefMut<'_>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for World
impl !RefUnwindSafe for World
impl !Send for World
impl !Sync for World
impl Unpin for World
impl !UnwindSafe for World
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