pub struct Soa<T: SoaLayout>(/* private fields */);Expand description
A query that reads a field-SoA component by value.
A component stored field-SoA (#[component(layout = "soa")]) cannot be
borrowed as &T — its bytes are split across per-field lanes, not laid out
as a contiguous T — so it is queried as Soa<T>, which yields an owned
T reconstructed (gathered) from the lanes. For the bulk SIMD path that is
the point of the layout, use World::for_each_soa_column_mut instead;
Soa<T> is the per-row, mix-with-other-components access.
Trait Implementations§
Source§impl<T: SoaLayout> WorldQuery for Soa<T>
impl<T: SoaLayout> WorldQuery for Soa<T>
Source§type Item<'a> = T
type Item<'a> = T
The type of item that the query iterator will yield (e.g.,
(&'a Position, &'a mut Velocity)).Source§fn type_ids() -> Vec<TypeId>
fn type_ids() -> Vec<TypeId>
Returns the sorted list of
TypeIds for the components to be INCLUDED in the query.
This signature is used to find ComponentPages that contain all these components.Source§unsafe fn fetch<'a>(
page_ptr: *const ComponentPage,
row_index: usize,
) -> Self::Item<'a>
unsafe fn fetch<'a>( page_ptr: *const ComponentPage, row_index: usize, ) -> Self::Item<'a>
Fetches the query’s item from a specific row in a
ComponentPage. Read moreSource§unsafe fn fetch_from_world<'a>(
world: *const World,
entity_id: EntityId,
) -> Option<Self::Item<'a>>
unsafe fn fetch_from_world<'a>( world: *const World, entity_id: EntityId, ) -> Option<Self::Item<'a>>
Fetches the query’s item directly from the world for a specific entity. Read more
Source§fn without_type_ids() -> Vec<TypeId>
fn without_type_ids() -> Vec<TypeId>
Returns the sorted list of
TypeIds for components to be EXCLUDED from the query.
Used to filter out pages that contain these components.Source§fn mutable_type_ids() -> Vec<TypeId>
fn mutable_type_ids() -> Vec<TypeId>
Returns the
TypeIds of the components this query accesses mutably
(&mut T / Option<&mut T> terms). World::query_mut uses this to
mark the matching domains changed once per query construction.
Read-only terms and filters return nothing (the default).Auto Trait Implementations§
impl<T> Freeze for Soa<T>
impl<T> RefUnwindSafe for Soa<T>where
T: RefUnwindSafe,
impl<T> Send for Soa<T>
impl<T> Sync for Soa<T>
impl<T> Unpin for Soa<T>where
T: Unpin,
impl<T> UnsafeUnpin for Soa<T>
impl<T> UnwindSafe for Soa<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
Mutably borrows from an owned value. Read more