pub struct Query<'w, 's, Q: WorldQuery, F: ReadOnlyWorldQuery = ()> { /* private fields */ }Implementations§
source§impl<'w, 's, Q: WorldQuery, F: ReadOnlyWorldQuery> Query<'w, 's, Q, F>
impl<'w, 's, Q: WorldQuery, F: ReadOnlyWorldQuery> Query<'w, 's, Q, F>
sourcepub unsafe fn new(
world: &'w World,
state: &'s mut QueryState<Q, F>,
last_change_tick: u32,
change_tick: u32
) -> Self
pub unsafe fn new(
world: &'w World,
state: &'s mut QueryState<Q, F>,
last_change_tick: u32,
change_tick: u32
) -> Self
Safety
worldmust be the same world that was used to create thisQueryState.
pub fn is_empty(&self) -> bool
pub fn contains(&self, entity: Entity) -> bool
pub fn get(&self, entity: Entity) -> Option<ReadOnlyQueryItem<'_, Q>>
pub fn get_mut(&mut self, entity: Entity) -> Option<QueryItem<'_, Q>>
pub fn iter(&self) -> QueryIter<'_, 's, Q::ReadOnly, F::ReadOnly> ⓘ
pub fn iter_mut(&mut self) -> QueryIter<'_, 's, Q, F> ⓘ
Trait Implementations§
source§impl<'w, 's, Q: WorldQuery, F: ReadOnlyWorldQuery> IntoIterator for &'w Query<'_, 's, Q, F>
impl<'w, 's, Q: WorldQuery, F: ReadOnlyWorldQuery> IntoIterator for &'w Query<'_, 's, Q, F>
§type Item = <<Q as WorldQuery>::ReadOnly as WorldQuery>::Item<'w>
type Item = <<Q as WorldQuery>::ReadOnly as WorldQuery>::Item<'w>
The type of the elements being iterated over.
§type IntoIter = QueryIter<'w, 's, <Q as WorldQuery>::ReadOnly, <F as WorldQuery>::ReadOnly>
type IntoIter = QueryIter<'w, 's, <Q as WorldQuery>::ReadOnly, <F as WorldQuery>::ReadOnly>
Which kind of iterator are we turning this into?
source§impl<'w, 's, Q: WorldQuery, F: ReadOnlyWorldQuery> IntoIterator for &'w mut Query<'_, 's, Q, F>
impl<'w, 's, Q: WorldQuery, F: ReadOnlyWorldQuery> IntoIterator for &'w mut Query<'_, 's, Q, F>
source§impl<'w, 's, Q, F> SystemParam for Query<'w, 's, Q, F>where
Q: WorldQuery + 'static,
F: ReadOnlyWorldQuery + 'static,
impl<'w, 's, Q, F> SystemParam for Query<'w, 's, Q, F>where
Q: WorldQuery + 'static,
F: ReadOnlyWorldQuery + 'static,
type Fetch = QueryState<Q, F>
Auto Trait Implementations§
impl<'w, 's, Q, F = ()> !RefUnwindSafe for Query<'w, 's, Q, F>
impl<'w, 's, Q, F> Send for Query<'w, 's, Q, F>
impl<'w, 's, Q, F> Sync for Query<'w, 's, Q, F>
impl<'w, 's, Q, F> Unpin for Query<'w, 's, Q, F>
impl<'w, 's, Q, F = ()> !UnwindSafe for Query<'w, 's, Q, F>
Blanket Implementations§
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read moresource§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read moresource§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read moresource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read more