Struct ambient_api::ecs::GeneralQueryBuilder
source · pub struct GeneralQueryBuilder<Components>(/* private fields */)
where
Components: ComponentsTuple + Copy + Clone + 'static;
Expand description
Build a GeneralQuery for the ECS. This is how you find entities in the game world.
Implementations§
source§impl<Components> GeneralQueryBuilder<Components>
impl<Components> GeneralQueryBuilder<Components>
sourcepub fn requires(
self,
requires: impl ComponentsTuple
) -> GeneralQueryBuilder<Components>
pub fn requires( self, requires: impl ComponentsTuple ) -> GeneralQueryBuilder<Components>
The entities must include the components in requires
.
sourcepub fn excludes(
self,
excludes: impl ComponentsTuple
) -> GeneralQueryBuilder<Components>
pub fn excludes( self, excludes: impl ComponentsTuple ) -> GeneralQueryBuilder<Components>
The entities must not include the components in exclude
.
sourcepub fn build(self) -> GeneralQuery<Components>
pub fn build(self) -> GeneralQuery<Components>
Builds a GeneralQuery.
sourcepub fn each_frame<R>(
self,
callback: impl FnMut(Vec<(EntityId, <Components as ComponentsTuple>::Data)>) -> R + 'static
) -> Listenerwhere
R: CallbackReturn,
pub fn each_frame<R>(
self,
callback: impl FnMut(Vec<(EntityId, <Components as ComponentsTuple>::Data)>) -> R + 'static
) -> Listenerwhere
R: CallbackReturn,
Consume this query and call callback
(fn
) each frame with the result of the query.
Auto Trait Implementations§
impl<Components> RefUnwindSafe for GeneralQueryBuilder<Components>where
Components: RefUnwindSafe,
impl<Components> Send for GeneralQueryBuilder<Components>where
Components: Send,
impl<Components> Sync for GeneralQueryBuilder<Components>where
Components: Sync,
impl<Components> Unpin for GeneralQueryBuilder<Components>where
Components: Unpin,
impl<Components> UnwindSafe for GeneralQueryBuilder<Components>where
Components: UnwindSafe,
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 T
impl<T> Downcast for T
source§impl<T> ElementComponentName for T
impl<T> ElementComponentName for T
source§fn element_component_name(&self) -> &'static str
fn element_component_name(&self) -> &'static str
Returns the name of the type implementing ElementComponent.