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