Struct constellation::MapResource
[−]
[src]
pub struct MapResource<T: Any + Send + Sync> { /* fields omitted */ }
A MapResource
stores per-entity data in a HashMap
.
This entity resource is suitable for data which is only present for a small
portion of the total entities in the World
.
Methods
impl<T: Any + Send + Sync> MapResource<T>
[src]
fn new() -> MapResource<T>
Constructs a new MapResource
.
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 = MapStorage<T>>
fn iter_components(&self) -> Values<Entity, T>
Gets an iterator over all entity data stored in the resource.
fn iter_components_mut(&mut self) -> ValuesMut<Entity, T>
Gets an iterator over all entity data stored in the resource.
fn iter(&self) -> Iter<Entity, T>
Gets an iterator over all entity data stored in the resource.
fn iter_mut(&mut self) -> IterMut<Entity, T>
Gets an iterator over all entity data stored in the resource.
Trait Implementations
impl<T: Any + Send + Sync> Resource for MapResource<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<MapResource<T>>
Converts this resource into a ResourceBuilder
for constructing itself.
impl<T: Any + Send + Sync> EntityResource for MapResource<T>
[src]
type Api = MapStorage<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, &MapStorage<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 MapStorage<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 MapResource<T>
[src]
type Target = MapStorage<T>
The resulting type after dereferencing
fn deref(&self) -> &MapStorage<T>
The method called to dereference a value
impl<T: Any + Send + Sync> DerefMut for MapResource<T>
[src]
fn deref_mut(&mut self) -> &mut MapStorage<T>
The method called to mutably dereference a value