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],
range: Range<u32>,
) -> 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],
range: Range<u32>,
) -> Self::Contiguous<'w, 's>
unsafe fn fetch_contiguous<'w, 's>( state: &'s Self::State, fetch: &mut Self::Fetch<'w>, entities: &'w [Entity], range: Range<u32>, ) -> 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.
The given range specifies the range of rows of the table that will be returned and must be valid.
§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. rangemust specify a valid range of rows in the table.range.startmust be less thanrange.end.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl ContiguousQueryData for ()
impl ContiguousQueryData for ()
type Contiguous<'w, 's> = ()
unsafe fn fetch_contiguous<'w, 's>( state: &'s <() as WorldQuery>::State, fetch: &mut <() as WorldQuery>::Fetch<'w>, entities: &'w [Entity], range: Range<u32>, ) -> <() as ContiguousQueryData>::Contiguous<'w, 's>
Source§impl<F> ContiguousQueryData for (F₁, F₂, …, Fₙ)where
F: ContiguousQueryData,
This trait is implemented for tuples up to 15 items long.
impl<F> ContiguousQueryData for (F₁, F₂, …, Fₙ)where
F: ContiguousQueryData,
This trait is implemented for tuples up to 15 items long.
type Contiguous<'w, 's> = (<F as ContiguousQueryData>::Contiguous<'w, 's>,)
unsafe fn fetch_contiguous<'w, 's>( state: &'s <(F,) as WorldQuery>::State, fetch: &mut <(F,) as WorldQuery>::Fetch<'w>, entities: &'w [Entity], range: Range<u32>, ) -> <(F,) as ContiguousQueryData>::Contiguous<'w, 's>
Source§impl<T> ContiguousQueryData for &Twhere
T: Component,
impl<T> ContiguousQueryData for &Twhere
T: Component,
type Contiguous<'w, 's> = &'w [T]
unsafe fn fetch_contiguous<'w, 's>( _state: &'s <&T as WorldQuery>::State, fetch: &mut <&T as WorldQuery>::Fetch<'w>, entities: &'w [Entity], range: Range<u32>, ) -> <&T as ContiguousQueryData>::Contiguous<'w, 's>
Source§impl<T> ContiguousQueryData for &mut T
impl<T> ContiguousQueryData for &mut T
type Contiguous<'w, 's> = ContiguousMut<'w, T>
unsafe fn fetch_contiguous<'w, 's>( _state: &'s <&mut T as WorldQuery>::State, fetch: &mut <&mut T as WorldQuery>::Fetch<'w>, _entities: &'w [Entity], range: Range<u32>, ) -> <&mut T as ContiguousQueryData>::Contiguous<'w, 's>
Source§impl<T> ContiguousQueryData for Option<T>where
T: ContiguousQueryData,
impl<T> ContiguousQueryData for Option<T>where
T: ContiguousQueryData,
type Contiguous<'w, 's> = Option<<T as ContiguousQueryData>::Contiguous<'w, 's>>
unsafe fn fetch_contiguous<'w, 's>( state: &'s <Option<T> as WorldQuery>::State, fetch: &mut <Option<T> as WorldQuery>::Fetch<'w>, entities: &'w [Entity], range: Range<u32>, ) -> <Option<T> as ContiguousQueryData>::Contiguous<'w, 's>
Implementors§
Source§impl ContiguousQueryData for AnyOf<()>
impl ContiguousQueryData for AnyOf<()>
type Contiguous<'w, 's> = ()
Source§impl ContiguousQueryData for Entity
impl ContiguousQueryData for Entity
type Contiguous<'w, 's> = &'w [Entity]
Source§impl<'__w, T> ContiguousQueryData for Mut<'__w, T>
impl<'__w, T> ContiguousQueryData for Mut<'__w, T>
type Contiguous<'w, 's> = ContiguousMut<'w, T>
Source§impl<F> ContiguousQueryData for AnyOf<(F₁, F₂, …, Fₙ)>where
F: ContiguousQueryData,
This trait is implemented for tuples up to 15 items long.
impl<F> ContiguousQueryData for AnyOf<(F₁, F₂, …, Fₙ)>where
F: ContiguousQueryData,
This trait is implemented for tuples up to 15 items long.