Struct legion::storage::PackedStorage [−][src]
pub struct PackedStorage<T: Component> { /* fields omitted */ }
Expand description
Stores a slice of components of type T
for each archetype.
Archetype slices are sorted according to the group that component T
belongs to.
Each slice may be packed into a single allocation to optimise for group-based access.
Trait Implementations
type Iter = ComponentIter<'a, T>
type Iter = ComponentIter<'a, T>
An iterator of shared archetype slice references.
type IterMut = ComponentIterMut<'a, T>
type IterMut = ComponentIterMut<'a, T>
An iterator of mutable archetype slice references.
Copies new components into the specified archetype slice. Read more
Gets the component slice for the specified archetype.
unsafe fn get_mut(
&'a self,
ArchetypeIndex: ArchetypeIndex
) -> Option<ComponentSliceMut<'a, T>>
unsafe fn get_mut(
&'a self,
ArchetypeIndex: ArchetypeIndex
) -> Option<ComponentSliceMut<'a, T>>
Gets a mutable component slice for the specified archetype. Read more
Iterates through all archetype component slices.
Iterates through all mutable archetype component slices. Read more
fn transfer_component(
&mut self,
src_archetype: ArchetypeIndex,
src_component: ComponentIndex,
dst_archetype: ArchetypeIndex,
dst: &mut dyn UnknownComponentStorage
)
fn transfer_component(
&mut self,
src_archetype: ArchetypeIndex,
src_component: ComponentIndex,
dst_archetype: ArchetypeIndex,
dst: &mut dyn UnknownComponentStorage
)
Moves a component to a new storage.
fn move_component(
&mut self,
source: ArchetypeIndex,
index: ComponentIndex,
dst: ArchetypeIndex
)
fn move_component(
&mut self,
source: ArchetypeIndex,
index: ComponentIndex,
dst: ArchetypeIndex
)
Moves a component from one archetype to another.
Inserts a new empty component slice for an archetype into this storage.
fn transfer_archetype(
&mut self,
src_archetype: ArchetypeIndex,
dst_archetype: ArchetypeIndex,
dst: &mut dyn UnknownComponentStorage
)
fn transfer_archetype(
&mut self,
src_archetype: ArchetypeIndex,
dst_archetype: ArchetypeIndex,
dst: &mut dyn UnknownComponentStorage
)
Moves an archetype’s component slice to a new storage.
Removes a component from an archetype slice, swapping it with the last component in the slice.
A heuristic estimating cache misses for an iteration through all components due to archetype fragmentation.
Returns the component metadata.
Returns a pointer to the given archetype’s component slice.
Returns a pointer to the given archetype’s component slice. Read more
unsafe fn extend_memcopy_raw(
&mut self,
ArchetypeIndex: ArchetypeIndex,
ptr: *const u8,
count: usize
)
unsafe fn extend_memcopy_raw(
&mut self,
ArchetypeIndex: ArchetypeIndex,
ptr: *const u8,
count: usize
)
Writes new components into the given archetype’s component slice via a memcopy. Read more
Notifies the storage of the start of a new epoch.
Ensures that the given spare capacity is available for component insertions. This is a performance hint and
should not be required before extend_memcopy
is called. Read more
Auto Trait Implementations
impl<T> !RefUnwindSafe for PackedStorage<T>
impl<T> Unpin for PackedStorage<T>
impl<T> UnwindSafe for PackedStorage<T> where
T: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more