Struct specs::TrackedStorage
[−]
[src]
pub struct TrackedStorage<C, S = DenseVecStorage<C>> { /* fields omitted */ }
Storage which tracks changes.
Methods
impl<C, S> TrackedStorage<C, S> where
C: Clone,
S: UnprotectedStorage<C>,
[src]
C: Clone,
S: UnprotectedStorage<C>,
pub fn change_events(&self) -> &[Change]
[src]
Returns a slice for all change events.
The elements are in entity order, that means the Change
for entity with id 5
will be the 6th element of this slice.
pub unsafe fn reset(&mut self, set: &BitSet)
[src]
Resets the TrackedStorage
.
impl<C, S> TrackedStorage<C, S> where
C: Clone + PartialEq,
S: UnprotectedStorage<C>,
[src]
C: Clone + PartialEq,
S: UnprotectedStorage<C>,
Trait Implementations
impl<C, S> Default for TrackedStorage<C, S> where
S: Default,
[src]
S: Default,
impl<C, S> UnprotectedStorage<C> for TrackedStorage<C, S> where
C: Clone,
S: UnprotectedStorage<C>,
[src]
C: Clone,
S: UnprotectedStorage<C>,
unsafe fn clean<F>(&mut self, f: F) where
F: Fn(Index) -> bool,
[src]
F: Fn(Index) -> bool,
Clean the storage given a check to figure out if an index is valid or not. Allows us to safely drop the storage. Read more
unsafe fn get(&self, id: Index) -> &C
[src]
Tries reading the data associated with an Index
. This is unsafe because the external set used to protect this storage is absent. Read more
unsafe fn get_mut(&mut self, id: Index) -> &mut C
[src]
Tries mutating the data associated with an Index
. This is unsafe because the external set used to protect this storage is absent. Read more
unsafe fn insert(&mut self, id: Index, value: C)
[src]
Inserts new data for a given Index
.
unsafe fn remove(&mut self, id: Index) -> C
[src]
Removes the data associated with an Index
.