pub trait ContiguousQueryData: ArchetypeQueryData + IterQueryData {
type Contiguous<'w, 's>;
// Required method
unsafe fn fetch_contiguous<'w, 's>(
state: &'s Self::State,
fetch: &mut Self::Fetch<'w>,
entities: &'w [Entity],
) -> Self::Contiguous<'w, 's>;
}Expand description
A QueryData which allows getting a direct access to contiguous chunks of components’
values, which may be used to apply simd-operations.
Contiguous iteration may be done via:
Required Associated Types§
Sourcetype Contiguous<'w, 's>
type Contiguous<'w, 's>
Item returned by ContiguousQueryData::fetch_contiguous.
Represents a contiguous chunk of memory.
Required Methods§
Sourceunsafe fn fetch_contiguous<'w, 's>(
state: &'s Self::State,
fetch: &mut Self::Fetch<'w>,
entities: &'w [Entity],
) -> Self::Contiguous<'w, 's>
unsafe fn fetch_contiguous<'w, 's>( state: &'s Self::State, fetch: &mut Self::Fetch<'w>, entities: &'w [Entity], ) -> Self::Contiguous<'w, 's>
Fetch ContiguousQueryData::Contiguous which represents a contiguous chunk of memory (e.g., an array) in the current Table.
This must always be called after WorldQuery::set_table.
§Safety
- Must always be called after
WorldQuery::set_table. entities’s length must match the length of the set table.entitiesmust match the entities of the set table.- There must not be simultaneous conflicting component access registered in
update_component_access.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl ContiguousQueryData for ()
impl ContiguousQueryData for ()
type Contiguous<'w, 's> = ()
unsafe fn fetch_contiguous<'w, 's>( state: &'s Self::State, fetch: &mut Self::Fetch<'w>, entities: &'w [Entity], ) -> Self::Contiguous<'w, 's>
Source§impl<F: ContiguousQueryData> ContiguousQueryData for (F₁, F₂, …, Fₙ)
This trait is implemented for tuples up to 16 items long.
impl<F: ContiguousQueryData> ContiguousQueryData for (F₁, F₂, …, Fₙ)
This trait is implemented for tuples up to 16 items long.
type Contiguous<'w, 's> = (<F as ContiguousQueryData>::Contiguous<'w, 's>,)
unsafe fn fetch_contiguous<'w, 's>( state: &'s Self::State, fetch: &mut Self::Fetch<'w>, entities: &'w [Entity], ) -> Self::Contiguous<'w, 's>
Source§impl<T: Component> ContiguousQueryData for &T
impl<T: Component> ContiguousQueryData for &T
type Contiguous<'w, 's> = &'w [T]
unsafe fn fetch_contiguous<'w, 's>( _state: &'s Self::State, fetch: &mut Self::Fetch<'w>, entities: &'w [Entity], ) -> Self::Contiguous<'w, 's>
Source§impl<T: Component<Mutability = Mutable>> ContiguousQueryData for &mut T
impl<T: Component<Mutability = Mutable>> ContiguousQueryData for &mut T
type Contiguous<'w, 's> = ContiguousMut<'w, T>
unsafe fn fetch_contiguous<'w, 's>( _state: &'s Self::State, fetch: &mut Self::Fetch<'w>, entities: &'w [Entity], ) -> Self::Contiguous<'w, 's>
Source§impl<T: ContiguousQueryData> ContiguousQueryData for Option<T>
impl<T: ContiguousQueryData> ContiguousQueryData for Option<T>
type Contiguous<'w, 's> = Option<<T as ContiguousQueryData>::Contiguous<'w, 's>>
unsafe fn fetch_contiguous<'w, 's>( state: &'s Self::State, fetch: &mut Self::Fetch<'w>, entities: &'w [Entity], ) -> Self::Contiguous<'w, 's>
Implementors§
Source§impl ContiguousQueryData for Entity
impl ContiguousQueryData for Entity
type Contiguous<'w, 's> = &'w [Entity]
Source§impl ContiguousQueryData for AnyOf<()>
impl ContiguousQueryData for AnyOf<()>
type Contiguous<'w, 's> = ()
Source§impl<'__w, T: Component<Mutability = Mutable>> ContiguousQueryData for Mut<'__w, T>
impl<'__w, T: Component<Mutability = Mutable>> ContiguousQueryData for Mut<'__w, T>
type Contiguous<'w, 's> = ContiguousMut<'w, T>
Source§impl<F: ContiguousQueryData> ContiguousQueryData for AnyOf<(F₁, F₂, …, Fₙ)>
This trait is implemented for tuples up to 16 items long.
impl<F: ContiguousQueryData> ContiguousQueryData for AnyOf<(F₁, F₂, …, Fₙ)>
This trait is implemented for tuples up to 16 items long.