[−][src]Trait oxygengine_core::ecs::storage::UnprotectedStorage
Used by the framework to quickly join components.
Required methods
unsafe fn clean<B>(&mut self, has: B) where
B: BitSetLike,
B: BitSetLike,
Clean the storage given a bitset with bits set for valid indices. Allows us to safely drop the storage.
Safety
May only be called with the mask which keeps track of the elements existing in this storage.
unsafe fn get(&self, id: u32) -> &T
Tries reading the data associated with an Index.
This is unsafe because the external set used
to protect this storage is absent.
Safety
May only be called after a call to insert with id and
no following call to remove with id.
A mask should keep track of those states, and an id being contained
in the tracking mask is sufficient to call this method.
unsafe fn get_mut(&mut self, id: u32) -> &mut T
Tries mutating the data associated with an Index.
This is unsafe because the external set used
to protect this storage is absent.
Safety
May only be called after a call to insert with id and
no following call to remove with id.
A mask should keep track of those states, and an id being contained
in the tracking mask is sufficient to call this method.
unsafe fn insert(&mut self, id: u32, value: T)
Inserts new data for a given Index.
Safety
May only be called if insert was not called with id before, or
was reverted by a call to remove with `id.
A mask should keep track of those states, and an id missing from the
mask is sufficient to call insert.
unsafe fn remove(&mut self, id: u32) -> T
Removes the data associated with an Index.
Safety
May only be called if an element with id was inserted and not yet
removed / dropped.
Provided methods
unsafe fn drop(&mut self, id: u32)
Drops the data associated with an Index.
This is simply more efficient than remove and can be used if the data
is no longer needed.
Safety
May only be called if an element with id was inserted and not yet
removed / dropped.
Implementors
impl<C, T> UnprotectedStorage<C> for FlaggedStorage<C, T> where
C: Component,
T: UnprotectedStorage<C>, [src]
C: Component,
T: UnprotectedStorage<C>,
unsafe fn clean<B>(&mut self, has: B) where
B: BitSetLike, [src]
B: BitSetLike,
unsafe fn get(&self, id: u32) -> &C[src]
unsafe fn get_mut(&mut self, id: u32) -> &mut C[src]
unsafe fn insert(&mut self, id: u32, comp: C)[src]
unsafe fn remove(&mut self, id: u32) -> C[src]
impl<T> UnprotectedStorage<T> for BTreeStorage<T>[src]
unsafe fn clean<B>(&mut self, _has: B) where
B: BitSetLike, [src]
B: BitSetLike,
unsafe fn get(&self, id: u32) -> &T[src]
unsafe fn get_mut(&mut self, id: u32) -> &mut T[src]
unsafe fn insert(&mut self, id: u32, v: T)[src]
unsafe fn remove(&mut self, id: u32) -> T[src]
impl<T> UnprotectedStorage<T> for DefaultVecStorage<T> where
T: Default, [src]
T: Default,
unsafe fn clean<B>(&mut self, _has: B) where
B: BitSetLike, [src]
B: BitSetLike,
unsafe fn get(&self, id: u32) -> &T[src]
unsafe fn get_mut(&mut self, id: u32) -> &mut T[src]
unsafe fn insert(&mut self, id: u32, v: T)[src]
unsafe fn remove(&mut self, id: u32) -> T[src]
impl<T> UnprotectedStorage<T> for DenseVecStorage<T>[src]
unsafe fn clean<B>(&mut self, _has: B) where
B: BitSetLike, [src]
B: BitSetLike,
unsafe fn get(&self, id: u32) -> &T[src]
unsafe fn get_mut(&mut self, id: u32) -> &mut T[src]
unsafe fn insert(&mut self, id: u32, v: T)[src]
unsafe fn remove(&mut self, id: u32) -> T[src]
impl<T> UnprotectedStorage<T> for HashMapStorage<T>[src]
unsafe fn clean<B>(&mut self, _has: B) where
B: BitSetLike, [src]
B: BitSetLike,
unsafe fn get(&self, id: u32) -> &T[src]
unsafe fn get_mut(&mut self, id: u32) -> &mut T[src]
unsafe fn insert(&mut self, id: u32, v: T)[src]
unsafe fn remove(&mut self, id: u32) -> T[src]
impl<T> UnprotectedStorage<T> for NullStorage<T> where
T: Default, [src]
T: Default,
unsafe fn clean<B>(&mut self, _has: B) where
B: BitSetLike, [src]
B: BitSetLike,