Struct ambient_api_core::ecs::EventQuery
source · pub struct EventQuery<Components: ComponentsTuple + Copy + Clone + 'static>(/* private fields */);
Expand description
An ECS query that calls a callback when its associated event occurs.
Implementations§
source§impl<Components: ComponentsTuple + Copy + Clone + 'static> EventQuery<Components>
impl<Components: ComponentsTuple + Copy + Clone + 'static> EventQuery<Components>
sourcepub fn create(event: QueryEvent, components: Components) -> Self
pub fn create(event: QueryEvent, components: Components) -> Self
Creates a new EventQuery that will find entities that have the specified components
that will call its bound function when the event
occurs.
sourcepub fn requires(self, requires: impl ComponentsTuple) -> Self
pub fn requires(self, requires: impl ComponentsTuple) -> Self
The entities must include the components in requires
.
sourcepub fn excludes(self, excludes: impl ComponentsTuple) -> Self
pub fn excludes(self, excludes: impl ComponentsTuple) -> Self
The entities must not include the components in excludes
.
Auto Trait Implementations§
impl<Components> RefUnwindSafe for EventQuery<Components>where
Components: RefUnwindSafe,
impl<Components> Send for EventQuery<Components>where
Components: Send,
impl<Components> Sync for EventQuery<Components>where
Components: Sync,
impl<Components> Unpin for EventQuery<Components>where
Components: Unpin,
impl<Components> UnwindSafe for EventQuery<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