Struct constellation::VecResource
[−]
[src]
pub struct VecResource<T: Any + Send + Sync> { /* fields omitted */ }
A VecResource
stores per-entity data in a Vec
.
This entity resource is suitable for data which is present for almost all of
the total entities in the World
. The VecResource
provides fast
sequential access as long as it maintains high occupancy.
Methods
impl<T: Any + Send + Sync> VecResource<T>
[src]
fn new() -> VecResource<T>
Constructs a new VecResource
.
fn add(&mut self, entity: Entity, component: T)
Adds entity data to the resource.
fn remove(&mut self, entity: Entity) -> Option<T>
Removes entity data from the resource.
Methods from Deref<Target = VecStorage<T>>
fn iter(&self) -> VecStorageIter<T>
Gets an iterator over immutable references to all entity data stored in the resource.
fn iter_mut(&mut self) -> VecStorageIterMut<T>
Gets an iterator over mutable references to all entity data stored in the resource.
Trait Implementations
impl<T: Any + Send + Sync> Resource for VecResource<T>
[src]
fn clear_entity_data(&mut self, entities: &[Entity])
Clears all data related to the given entities from the resource.
fn to_builder(self) -> ResourceBuilder<VecResource<T>>
Converts this resource into a ResourceBuilder
for constructing itself.
impl<T: Any + Send + Sync> EntityResource for VecResource<T>
[src]
type Api = VecStorage<T>
The type of API used to access the resource while its filter is write-locked behind a borrow. Read more
fn deconstruct(&self) -> (&BitSet, &VecStorage<T>)
Splits the entity resource into a bitset used for entity iteration, and its restricted API. Read more
fn deconstruct_mut(&mut self) -> (&BitSet, &mut VecStorage<T>)
Splits the entity resource into a bitset used for entity iteration, and its restricted API. Read more
impl<T: Any + Send + Sync> Deref for VecResource<T>
[src]
type Target = VecStorage<T>
The resulting type after dereferencing
fn deref(&self) -> &VecStorage<T>
The method called to dereference a value
impl<T: Any + Send + Sync> DerefMut for VecResource<T>
[src]
fn deref_mut(&mut self) -> &mut VecStorage<T>
The method called to mutably dereference a value