[−][src]Struct async_ecs::entity::entities::Entities
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
Read<Entities>
.
Please note that you should never get 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.
Implementations
impl Entities
[src]
pub fn allocate(&mut self) -> Entity
[src]
Creates a new entity. This will be persistent after this call.
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.
pub fn create_iter(&self) -> CreateIterAtomic<'_>ⓘNotable traits for CreateIterAtomic<'a>
impl<'a> Iterator for CreateIterAtomic<'a> type Item = Entity;
[src]
Notable traits for CreateIterAtomic<'a>
impl<'a> Iterator for CreateIterAtomic<'a> type Item = Entity;
Returns an iterator which creates new entities atomically.
They will be persistent as soon as you call World::maintain
.
pub fn build_entity(&self) -> AtomicBuilder<'_>
[src]
Similar to the create
method above this creates an entity atomically,
and then returns a builder which can be used to insert components into
various storages if available.
pub fn kill(&mut self, delete: &[Entity]) -> Result<(), Error>
[src]
Kills a list of entities immediately.
pub fn delete(&self, entity: Entity) -> Result<(), Error>
[src]
Deletes an entity atomically.
The associated components will be deleted as soon as you call World::maintain
.
pub fn is_alive(&self, entity: Entity) -> bool
[src]
Returns true
if the specified entity is alive.
pub fn maintain(&mut self) -> Vec<Entity>
[src]
Maintains the allocated entities, mainly dealing with atomically allocated or killed entities.
Trait Implementations
impl Default for Entities
[src]
impl<'a> Join for &'a Entities
[src]
type Mask = &'a BitSet
Type of joined bit mask.
type Type = Entity
Type of joined components.
type Value = Self
Type of joined storages.
pub unsafe fn open(self) -> (Self::Mask, Self)
[src]
pub unsafe fn get(v: &mut &'a Entities, index: Index) -> Entity
[src]
pub fn join(self) -> JoinIter<Self>ⓘ where
Self: Sized,
[src]
Self: Sized,
pub fn maybe(self) -> MaybeJoin<Self> where
Self: Sized,
[src]
Self: Sized,
pub fn is_unconstrained() -> bool
[src]
impl<'a> ParJoin for &'a Entities
[src]
pub fn par_join(self) -> JoinParIter<Self> where
Self: Sized,
[src]
Self: Sized,
Auto Trait Implementations
impl RefUnwindSafe for Entities
impl Send for Entities
impl Sync for Entities
impl Unpin for Entities
impl UnwindSafe for Entities
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
[src]
T: Any,
pub fn get_type_id(&self) -> TypeId
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Resource for T where
T: Any + Send + Sync,
[src]
T: Any + Send + Sync,
impl<T> TryDefault for T where
T: Default,
[src]
T: Default,
pub fn try_default() -> Result<T, String>
[src]
pub fn unwrap_default() -> Self
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,