Struct specs::world::EntitiesRes
[−]
[src]
pub struct EntitiesRes { /* fields omitted */ }
The entities of this ECS. This is a resource, stored in the World
.
If you just want to access it in your system, you can also use the Entities
type def.
Please note that you should never fetch this mutably in a system, because it would block all the other systems.
You need to call World::maintain
after creating / deleting
entities with this struct.
Methods
impl EntitiesRes
[src]
pub fn create(&self) -> Entity
[src]
Creates a new entity atomically.
This will be persistent as soon
as you call World::maintain
.
If you want a lazy entity builder, take a look
at LazyUpdate::create_entity
.
In case you have access to the World
,
you can also use World::create_entity
which
creates the entity and the components immediately.
ⓘImportant traits for CreateIterAtomic<'a>pub fn create_iter(&self) -> CreateIterAtomic
[src]
Returns an iterator which creates
new entities atomically.
They will be persistent as soon
as you call World::maintain
.
pub fn delete(&self, e: Entity) -> Result<(), WrongGeneration>
[src]
Deletes an entity atomically.
The associated components will be
deleted as soon as you call World::maintain
.
pub fn entity(&self, id: Index) -> Entity
[src]
Returns an entity with a given id
. There's no guarantee for validity,
meaning the entity could be not alive.
pub fn is_alive(&self, e: Entity) -> bool
[src]
Returns true
if the specified entity is alive.
Trait Implementations
impl Debug for EntitiesRes
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Default for EntitiesRes
[src]
fn default() -> EntitiesRes
[src]
Returns the "default value" for a type. Read more
impl<'a> Join for &'a EntitiesRes
[src]
type Type = Entity
Type of joined components.
type Value = Self
Type of joined storages.
type Mask = BitSetOr<&'a BitSet, &'a AtomicBitSet>
Type of joined bit mask.
fn open(self) -> (Self::Mask, Self)
[src]
Open this join by returning the mask and the storages.
unsafe fn get(v: &mut &'a EntitiesRes, idx: Index) -> Entity
[src]
Get a joined component value by a given index.
ⓘImportant traits for JoinIter<J>fn join(self) -> JoinIter<Self> where
Self: Sized,
[src]
Self: Sized,
Create a joined iterator over the contents.
impl<'a> ParJoin for &'a EntitiesRes
[src]
fn par_join(self) -> JoinParIter<Self> where
Self: Sized,
[src]
Self: Sized,
Create a joined parallel iterator over the contents.