Type Alias specs::world::Entities

source ·
pub type Entities<'a> = Read<'a, EntitiesRes>;
Expand description

A wrapper for a read Entities resource. Note that this is just Read<Entities>, so you can easily use it in your system:

type SystemData = (Entities<'a> /* ... */,);

Please note that you should call World::maintain after creating / deleting entities with this resource.

When .joining on Entities, you will need to do it like this:

use specs::prelude::*;

for (e, pos) in (&entities, &positions).join() {
    // Do something
}

Aliased Type§

struct Entities<'a> { /* private fields */ }

Trait Implementations§

source§

impl<'a, T, F> Deref for Read<'a, T, F>where T: Resource,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
source§

impl<'a, T, F> From<Fetch<'a, T>> for Read<'a, T, F>

source§

fn from(inner: Fetch<'a, T>) -> Read<'a, T, F>

Converts to this type from the input type.
source§

impl<'a, T, F> SystemData<'a> for Read<'a, T, F>where T: Resource, F: SetupHandler<T>,

source§

fn setup(world: &mut World)

Sets up the system data for fetching it from the World.
source§

fn fetch(world: &'a World) -> Read<'a, T, F>

Fetches the system data from World. Note that this is only specified for one concrete lifetime 'a, you need to implement the SystemData trait for every possible lifetime.
source§

fn reads() -> Vec<ResourceId, Global>

Returns all read dependencies as fetched from Self::fetch. Read more
source§

fn writes() -> Vec<ResourceId, Global>

Returns all write dependencies as fetched from Self::fetch. Read more