pub struct Query<'w, T> { /* private fields */ }Expand description
Implementations§
Source§impl<'w, T> Query<'w, T>where
T: QueryTuple<'w>,
impl<'w, T> Query<'w, T>where
T: QueryTuple<'w>,
Sourcepub fn not_tagged(self, tag: &str) -> Query<'w, T>
pub fn not_tagged(self, tag: &str) -> Query<'w, T>
Exclude entities with this tag
Sourcepub fn with<C>(self) -> Query<'w, T>where
C: Component,
pub fn with<C>(self) -> Query<'w, T>where
C: Component,
Filters entities that have this component without fetching it
Useful when you need to check component existence but don’t need the data.
§Example
ⓘ
// Find all entities with Health that also have Velocity
world.select::<(Health,)>()
.with::<Velocity>()
.each(|entity, (health,)| {
println!("Fast entity: {}", health.0);
});Auto Trait Implementations§
impl<'w, T> Freeze for Query<'w, T>
impl<'w, T> !RefUnwindSafe for Query<'w, T>
impl<'w, T> Send for Query<'w, T>where
T: Send,
impl<'w, T> Sync for Query<'w, T>where
T: Sync,
impl<'w, T> Unpin for Query<'w, T>where
T: Unpin,
impl<'w, T> !UnwindSafe for Query<'w, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§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.Source§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.