pub struct QueryBuilder<'w, Q: WorldQuery, F: QueryFilter = ()> { /* private fields */ }Expand description
Builder for constructing and executing queries.
Created by World::query(). Chain .with::<T>() and .without::<T>()
to add filters, then call .iter() or .get(id) to execute.
Implementations§
Source§impl<'w, Q: WorldQuery, F: QueryFilter> QueryBuilder<'w, Q, F>
impl<'w, Q: WorldQuery, F: QueryFilter> QueryBuilder<'w, Q, F>
Sourcepub const fn with<T: 'static>(self) -> QueryBuilder<'w, Q, (F, With<T>)>where
(F, With<T>): QueryFilter,
pub const fn with<T: 'static>(self) -> QueryBuilder<'w, Q, (F, With<T>)>where
(F, With<T>): QueryFilter,
Add a With<T> filter — only match entities that have built-in component T.
Sourcepub const fn without<T: 'static>(self) -> QueryBuilder<'w, Q, (F, Without<T>)>where
(F, Without<T>): QueryFilter,
pub const fn without<T: 'static>(self) -> QueryBuilder<'w, Q, (F, Without<T>)>where
(F, Without<T>): QueryFilter,
Add a Without<T> filter — exclude entities that have built-in component T.
Sourcepub const fn ext_with<T: 'static + Send + Sync>(
self,
) -> QueryBuilder<'w, Q, (F, ExtWith<T>)>where
(F, ExtWith<T>): QueryFilter,
pub const fn ext_with<T: 'static + Send + Sync>(
self,
) -> QueryBuilder<'w, Q, (F, ExtWith<T>)>where
(F, ExtWith<T>): QueryFilter,
Add an ExtWith<T> filter — only match entities with extension component T.
Sourcepub const fn ext_without<T: 'static + Send + Sync>(
self,
) -> QueryBuilder<'w, Q, (F, ExtWithout<T>)>where
(F, ExtWithout<T>): QueryFilter,
pub const fn ext_without<T: 'static + Send + Sync>(
self,
) -> QueryBuilder<'w, Q, (F, ExtWithout<T>)>where
(F, ExtWithout<T>): QueryFilter,
Add an ExtWithout<T> filter — exclude entities with extension component T.
Auto Trait Implementations§
impl<'w, Q, F> Freeze for QueryBuilder<'w, Q, F>
impl<'w, Q, F = ()> !RefUnwindSafe for QueryBuilder<'w, Q, F>
impl<'w, Q, F> Send for QueryBuilder<'w, Q, F>
impl<'w, Q, F> Sync for QueryBuilder<'w, Q, F>
impl<'w, Q, F> Unpin for QueryBuilder<'w, Q, F>
impl<'w, Q, F> UnsafeUnpin for QueryBuilder<'w, Q, F>
impl<'w, Q, F = ()> !UnwindSafe for QueryBuilder<'w, Q, F>
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