Skip to main content

ContiguousQueryData

Trait ContiguousQueryData 

Source
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§

Source

type Contiguous<'w, 's>

Item returned by ContiguousQueryData::fetch_contiguous. Represents a contiguous chunk of memory.

Required Methods§

Source

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.
  • entities must 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 ()

Source§

type Contiguous<'w, 's> = ()

Source§

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.

Source§

type Contiguous<'w, 's> = (<F as ContiguousQueryData>::Contiguous<'w, 's>,)

Source§

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

Source§

type Contiguous<'w, 's> = &'w [T]

Source§

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

Source§

type Contiguous<'w, 's> = ContiguousMut<'w, T>

Source§

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>

Source§

type Contiguous<'w, 's> = Option<<T as ContiguousQueryData>::Contiguous<'w, 's>>

Source§

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

Source§

type Contiguous<'w, 's> = &'w [Entity]

Source§

impl ContiguousQueryData for AnyOf<()>

Source§

type Contiguous<'w, 's> = ()

Source§

impl<'__w, T: Component<Mutability = Mutable>> ContiguousQueryData for Mut<'__w, T>

Source§

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.

Source§

type Contiguous<'w, 's> = (Option<<F as ContiguousQueryData>::Contiguous<'w, 's>>,)

Source§

impl<T: Component> ContiguousQueryData for Ref<'_, T>

Source§

type Contiguous<'w, 's> = ContiguousRef<'w, T>

Source§

impl<T: Component> ContiguousQueryData for Has<T>

Source§

type Contiguous<'w, 's> = bool