Struct bevy::prelude::QueryState[]

pub struct QueryState<Q, F = ()> where
    F: WorldQuery,
    Q: WorldQuery,
    <F as WorldQuery>::Fetch: FilterFetch
{ /* fields omitted */ }

Implementations

impl<Q, F> QueryState<Q, F> where
    F: WorldQuery,
    Q: WorldQuery,
    <F as WorldQuery>::Fetch: FilterFetch

pub fn new(world: &mut World) -> QueryState<Q, F>

pub fn validate_world_and_update_archetypes(&mut self, world: &World)

pub fn new_archetype(&mut self, archetype: &Archetype)

pub fn get(
    &mut self,
    world: &'w World,
    entity: Entity
) -> Result<<<Q as WorldQuery>::Fetch as Fetch<'w>>::Item, QueryEntityError> where
    <Q as WorldQuery>::Fetch: ReadOnlyFetch

pub fn get_mut(
    &mut self,
    world: &'w mut World,
    entity: Entity
) -> Result<<<Q as WorldQuery>::Fetch as Fetch<'w>>::Item, QueryEntityError>

pub unsafe fn get_unchecked(
    &mut self,
    world: &'w World,
    entity: Entity
) -> Result<<<Q as WorldQuery>::Fetch as Fetch<'w>>::Item, QueryEntityError>

Safety

This does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query.

pub unsafe fn get_unchecked_manual(
    &self,
    world: &'w World,
    entity: Entity,
    last_change_tick: u32,
    change_tick: u32
) -> Result<<<Q as WorldQuery>::Fetch as Fetch<'w>>::Item, QueryEntityError>

Safety

This does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query.

pub fn iter(&'s mut self, world: &'w World) -> QueryIter<'w, 's, Q, F>

Notable traits for QueryIter<'w, 's, Q, F>

impl<'w, 's, Q, F> Iterator for QueryIter<'w, 's, Q, F> where
    F: WorldQuery,
    Q: WorldQuery,
    <F as WorldQuery>::Fetch: FilterFetch
type Item = <<Q as WorldQuery>::Fetch as Fetch<'w>>::Item;
where
    <Q as WorldQuery>::Fetch: ReadOnlyFetch

pub fn iter_mut(&'s mut self, world: &'w mut World) -> QueryIter<'w, 's, Q, F>

Notable traits for QueryIter<'w, 's, Q, F>

impl<'w, 's, Q, F> Iterator for QueryIter<'w, 's, Q, F> where
    F: WorldQuery,
    Q: WorldQuery,
    <F as WorldQuery>::Fetch: FilterFetch
type Item = <<Q as WorldQuery>::Fetch as Fetch<'w>>::Item;

pub unsafe fn iter_unchecked(
    &'s mut self,
    world: &'w World
) -> QueryIter<'w, 's, Q, F>

Notable traits for QueryIter<'w, 's, Q, F>

impl<'w, 's, Q, F> Iterator for QueryIter<'w, 's, Q, F> where
    F: WorldQuery,
    Q: WorldQuery,
    <F as WorldQuery>::Fetch: FilterFetch
type Item = <<Q as WorldQuery>::Fetch as Fetch<'w>>::Item;

Safety

This does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query.

pub fn for_each<'w>(
    &mut self,
    world: &'w World,
    func: impl FnMut(<<Q as WorldQuery>::Fetch as Fetch<'w>>::Item)
) where
    <Q as WorldQuery>::Fetch: ReadOnlyFetch

pub fn for_each_mut<'w>(
    &mut self,
    world: &'w mut World,
    func: impl FnMut(<<Q as WorldQuery>::Fetch as Fetch<'w>>::Item)
)

pub unsafe fn for_each_unchecked<'w>(
    &mut self,
    world: &'w World,
    func: impl FnMut(<<Q as WorldQuery>::Fetch as Fetch<'w>>::Item)
)

Safety

This does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query.

pub fn par_for_each<'w>(
    &mut self,
    world: &'w World,
    task_pool: &TaskPool,
    batch_size: usize,
    func: impl Fn(<<Q as WorldQuery>::Fetch as Fetch<'w>>::Item) + Send + Sync + Clone
) where
    <Q as WorldQuery>::Fetch: ReadOnlyFetch

pub fn par_for_each_mut<'w>(
    &mut self,
    world: &'w mut World,
    task_pool: &TaskPool,
    batch_size: usize,
    func: impl Fn(<<Q as WorldQuery>::Fetch as Fetch<'w>>::Item) + Send + Sync + Clone
)

pub unsafe fn par_for_each_unchecked<'w>(
    &mut self,
    world: &'w World,
    task_pool: &TaskPool,
    batch_size: usize,
    func: impl Fn(<<Q as WorldQuery>::Fetch as Fetch<'w>>::Item) + Send + Sync + Clone
)

Safety

This does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query.

pub unsafe fn par_for_each_unchecked_manual<'w>(
    &'s self,
    world: &'w World,
    task_pool: &TaskPool,
    batch_size: usize,
    func: impl Fn(<<Q as WorldQuery>::Fetch as Fetch<'w>>::Item) + Send + Sync + Clone,
    last_change_tick: u32,
    change_tick: u32
)

Safety

This does not check for mutable query correctness. To be safe, make sure mutable queries have unique access to the components they query. This does not validate that world.id() matches self.world_id. Calling this on a world with a mismatched WorldId is unsafe.

Trait Implementations

impl<'a, Q, F> SystemParamFetch<'a> for QueryState<Q, F> where
    F: 'static + WorldQuery,
    Q: 'static + WorldQuery,
    <F as WorldQuery>::Fetch: FilterFetch

type Item = Query<'a, Q, F>

impl<Q, F> SystemParamState for QueryState<Q, F> where
    F: 'static + WorldQuery,
    Q: 'static + WorldQuery,
    <F as WorldQuery>::Fetch: FilterFetch

type Config = ()

Auto Trait Implementations

impl<Q, F> RefUnwindSafe for QueryState<Q, F> where
    <F as WorldQuery>::State: RefUnwindSafe,
    <Q as WorldQuery>::State: RefUnwindSafe

impl<Q, F> Send for QueryState<Q, F>

impl<Q, F> Sync for QueryState<Q, F>

impl<Q, F> Unpin for QueryState<Q, F> where
    <F as WorldQuery>::State: Unpin,
    <Q as WorldQuery>::State: Unpin

impl<Q, F> UnwindSafe for QueryState<Q, F> where
    <F as WorldQuery>::State: UnwindSafe,
    <Q as WorldQuery>::State: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Component for T where
    T: 'static + Send + Sync

impl<T> Downcast for T where
    T: Any

impl<T> Downcast<T> for T

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Upcast<T> for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,