pub trait TriggerTargets {
// Required methods
fn components(&self) -> impl Iterator<Item = ComponentId> + Clone + '_;
fn entities(&self) -> impl Iterator<Item = Entity> + Clone + '_;
}
Expand description
Represents a collection of targets for a specific Trigger
of an Event
. Targets can be of type Entity
or ComponentId
.
When a trigger occurs for a given event and TriggerTargets
, any Observer
that watches for that specific event-target combination
will run.
Required Methods§
Sourcefn components(&self) -> impl Iterator<Item = ComponentId> + Clone + '_
fn components(&self) -> impl Iterator<Item = ComponentId> + Clone + '_
The components the trigger should target.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.