Struct bevy::prelude::QueryState [−]
Implementations
impl<Q, F> QueryState<Q, F> where
F: WorldQuery,
Q: WorldQuery,
<F as WorldQuery>::Fetch: FilterFetch,
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,
&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>
&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>
&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>
&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,
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;
<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;
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;
&'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,
&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)
)
&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)
)
&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,
&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
)
&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
)
&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
)
&'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,
F: 'static + WorldQuery,
Q: 'static + WorldQuery,
<F as WorldQuery>::Fetch: FilterFetch,
type Item = Query<'a, Q, F>
pub unsafe fn get_param(
state: &'a mut QueryState<Q, F>,
system_state: &'a SystemState,
world: &'a World,
change_tick: u32
) -> <QueryState<Q, F> as SystemParamFetch<'a>>::Item
state: &'a mut QueryState<Q, F>,
system_state: &'a SystemState,
world: &'a World,
change_tick: u32
) -> <QueryState<Q, F> as SystemParamFetch<'a>>::Item
impl<Q, F> SystemParamState for QueryState<Q, F> where
F: 'static + WorldQuery,
Q: 'static + WorldQuery,
<F as WorldQuery>::Fetch: FilterFetch,
F: 'static + WorldQuery,
Q: 'static + WorldQuery,
<F as WorldQuery>::Fetch: FilterFetch,
type Config = ()
pub fn init(
world: &mut World,
system_state: &mut SystemState,
_config: <QueryState<Q, F> as SystemParamState>::Config
) -> QueryState<Q, F>
world: &mut World,
system_state: &mut SystemState,
_config: <QueryState<Q, F> as SystemParamState>::Config
) -> QueryState<Q, F>
pub fn new_archetype(
&mut self,
archetype: &Archetype,
system_state: &mut SystemState
)
&mut self,
archetype: &Archetype,
system_state: &mut SystemState
)
pub fn default_config()
pub fn apply(&mut self, _world: &mut World)
Auto Trait Implementations
impl<Q, F> RefUnwindSafe for QueryState<Q, F> where
<F as WorldQuery>::State: RefUnwindSafe,
<Q as WorldQuery>::State: RefUnwindSafe,
<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,
<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,
<F as WorldQuery>::State: UnwindSafe,
<Q as WorldQuery>::State: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Component for T where
T: 'static + Send + Sync,
T: 'static + Send + Sync,
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> Downcast<T> for T
impl<T> DowncastSync for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
Notable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
pub fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
Notable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Upcast<T> for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,