Struct specs::storage::DenseVecStorage
source · pub struct DenseVecStorage<T> { /* private fields */ }
Expand description
Dense vector storage. Has a redirection 2-way table between entities and components, allowing to leave no gaps within the data.
Note that this only stores the data (T
) densely; indices
to the data are stored in a sparse Vec
.
as_slice()
and as_mut_slice()
indices are local to this
DenseVecStorage
at this particular moment. These indices
cannot be compared with indices from any other storage, and
a particular entity’s position within this slice may change
over time.
Trait Implementations§
source§impl<T> Default for DenseVecStorage<T>
impl<T> Default for DenseVecStorage<T>
Index
. Read moresource§impl<T> SliceAccess<T> for DenseVecStorage<T>
impl<T> SliceAccess<T> for DenseVecStorage<T>
source§fn as_slice(&self) -> &[Self::Element]
fn as_slice(&self) -> &[Self::Element]
Returns a slice of all the components in this storage.
Indices inside the slice do not correspond to anything in particular, and especially do not correspond with entity IDs.
source§fn as_mut_slice(&mut self) -> &mut [Self::Element]
fn as_mut_slice(&mut self) -> &mut [Self::Element]
Returns a mutable slice of all the components in this storage.
Indices inside the slice do not correspond to anything in particular, and especially do not correspond with entity IDs.
source§impl<T> UnprotectedStorage<T> for DenseVecStorage<T>
impl<T> UnprotectedStorage<T> for DenseVecStorage<T>
§type AccessMut<'a> = &'a mut T
where
T: 'a
type AccessMut<'a> = &'a mut T where T: 'a
source§unsafe fn clean<B>(&mut self, _has: B)where
B: BitSetLike,
unsafe fn clean<B>(&mut self, _has: B)where B: BitSetLike,
source§unsafe fn get(&self, id: Index) -> &T
unsafe fn get(&self, id: Index) -> &T
Index
. Read moresource§unsafe fn get_mut(&mut self, id: Index) -> &mut T
unsafe fn get_mut(&mut self, id: Index) -> &mut T
Index
. Read moreimpl<T> DistinctStorage for DenseVecStorage<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for DenseVecStorage<T>
impl<T> Send for DenseVecStorage<T>where T: Send,
impl<T> Sync for DenseVecStorage<T>where T: Sync,
impl<T> Unpin for DenseVecStorage<T>where T: Unpin,
impl<T> UnwindSafe for DenseVecStorage<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere T: Default,
source§fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
source§fn unwrap_default() -> Self
fn unwrap_default() -> Self
try_default
and panics on an error case.