Trait legion::storage::ComponentStorage [−][src]
A storage location for component data slices. Each component storage may hold once slice for each archetype inserted into the storage.
Associated Types
type Iter: Iterator<Item = ComponentSlice<'a, T>>
[src]
An iterator of shared archetype slice references.
type IterMut: Iterator<Item = ComponentSliceMut<'a, T>>
[src]
An iterator of mutable archetype slice references.
Required methods
fn len(&self) -> usize
[src]
Returns the number of archetype slices stored.
unsafe fn extend_memcopy(
&mut self,
archetype: ArchetypeIndex,
ptr: *const T,
len: usize
)
[src]
&mut self,
archetype: ArchetypeIndex,
ptr: *const T,
len: usize
)
Copies new components into the specified archetype slice.
Safety
The components located at ptr
are memcopied into the storage. If T
is not Copy
, then the
previous memory location should no longer be accessed.
fn get(&'a self, archetype: ArchetypeIndex) -> Option<ComponentSlice<'a, T>>
[src]
Gets the component slice for the specified archetype.
unsafe fn get_mut(
&'a self,
archetype: ArchetypeIndex
) -> Option<ComponentSliceMut<'a, T>>
[src]
&'a self,
archetype: ArchetypeIndex
) -> Option<ComponentSliceMut<'a, T>>
Gets a mutable component slice for the specified archetype.
Safety
Ensure that the requested archetype slice is not concurrently borrowed anywhere else such that memory is not mutably aliased.
fn iter(&'a self, start_inclusive: usize, end_exclusive: usize) -> Self::Iter
[src]
Iterates through all archetype component slices.
unsafe fn iter_mut(
&'a self,
start_inclusive: usize,
end_exclusive: usize
) -> Self::IterMut
[src]
&'a self,
start_inclusive: usize,
end_exclusive: usize
) -> Self::IterMut
Iterates through all mutable archetype component slices.
Safety
Ensure that all requested archetype slices are not concurrently borrowed anywhere else such that memory is not mutably aliased.
Provided methods
Loading content...Implementors
impl<'a, T: Component> ComponentStorage<'a, T> for PackedStorage<T>
[src]
type Iter = ComponentIter<'a, T>
type IterMut = ComponentIterMut<'a, T>
unsafe fn extend_memcopy(
&mut self,
archetype: ArchetypeIndex,
ptr: *const T,
count: usize
)
[src]
&mut self,
archetype: ArchetypeIndex,
ptr: *const T,
count: usize
)
fn get(
&'a self,
ArchetypeIndex: ArchetypeIndex
) -> Option<ComponentSlice<'a, T>>
[src]
&'a self,
ArchetypeIndex: ArchetypeIndex
) -> Option<ComponentSlice<'a, T>>
unsafe fn get_mut(
&'a self,
ArchetypeIndex: ArchetypeIndex
) -> Option<ComponentSliceMut<'a, T>>
[src]
&'a self,
ArchetypeIndex: ArchetypeIndex
) -> Option<ComponentSliceMut<'a, T>>
fn iter(&'a self, start_inclusive: usize, end_exclusive: usize) -> Self::Iter
[src]
unsafe fn iter_mut(
&'a self,
start_inclusive: usize,
end_exclusive: usize
) -> Self::IterMut
[src]
&'a self,
start_inclusive: usize,
end_exclusive: usize
) -> Self::IterMut