Struct chunked::chunk::Chunk [−][src]
pub struct Chunk { /* fields omitted */ }
A single Chunk
of entities of the same Archetype
.
The components are stored as a struct of arrays in one contiguous block of memory.
Implementations
impl Chunk
[src]
impl Chunk
[src]pub unsafe fn from_raw(
archetype: Arc<Archetype>,
ptr: NonNull<u8>,
len: usize
) -> Chunk
[src]
pub unsafe fn from_raw(
archetype: Arc<Archetype>,
ptr: NonNull<u8>,
len: usize
) -> Chunk
[src]Create a new chunk from the raw parts.
pub fn components<T: Component>(&self) -> Option<&[T]>
[src]
pub fn components<T: Component>(&self) -> Option<&[T]>
[src]Get a slice of components from this chunk.
pub fn components_mut<T: Component>(&mut self) -> Option<&mut [T]>
[src]
pub fn components_mut<T: Component>(&mut self) -> Option<&mut [T]>
[src]Get a mutable list of components from this chunk.
pub fn split_by_component_mut(&mut self) -> ChunkSplitter<'_>
[src]
pub fn split_by_component_mut(&mut self) -> ChunkSplitter<'_>
[src]Create a new ChunkSplitter
for accessing multiple component lists at the
same time.
pub fn update_at<'a>(
&mut self,
index: usize,
component_data: &impl ComponentData<'a>
)
[src]
pub fn update_at<'a>(
&mut self,
index: usize,
component_data: &impl ComponentData<'a>
)
[src]Update the components of an entity in this chunk at the given index.
pub fn replace_at<'a>(
&mut self,
index: usize,
component_data: &impl ComponentData<'a>
)
[src]
pub fn replace_at<'a>(
&mut self,
index: usize,
component_data: &impl ComponentData<'a>
)
[src]Replace the entity at the given index.
pub fn insert<'a>(
&mut self,
index: usize,
component_data: &impl ComponentData<'a>
)
[src]
pub fn insert<'a>(
&mut self,
index: usize,
component_data: &impl ComponentData<'a>
)
[src]Insert an entity into this chunk, using the factory function provided to fill components.
pub fn copy_from(
&mut self,
insert_at: usize,
other: &Chunk,
range: impl RangeBounds<usize>
)
[src]
pub fn copy_from(
&mut self,
insert_at: usize,
other: &Chunk,
range: impl RangeBounds<usize>
)
[src]Insert a number of entities from another chunk at the given index.
pub fn remove(&mut self, range: impl RangeBounds<usize>)
[src]
pub fn remove(&mut self, range: impl RangeBounds<usize>)
[src]Remove an entity from this chunk by its index into the chunk.
pub fn entity_by_index(self: &Arc<Chunk>, index: usize) -> Option<EntityEntry>
[src]
pub fn entity_by_index(self: &Arc<Chunk>, index: usize) -> Option<EntityEntry>
[src]Get an entity entry by index.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more