Trait valence::ecs::observer::TriggerTargets

pub trait TriggerTargets: Send + Sync + 'static {
    // Required methods
    fn components(&self) -> impl ExactSizeIterator;
    fn entities(&self) -> impl ExactSizeIterator;
}
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§

fn components(&self) -> impl ExactSizeIterator

The components the trigger should target.

fn entities(&self) -> impl ExactSizeIterator

The entities the trigger should target.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl TriggerTargets for ()

§

fn components(&self) -> impl ExactSizeIterator

§

fn entities(&self) -> impl ExactSizeIterator

§

impl TriggerTargets for Vec<ComponentId>

§

fn components(&self) -> impl ExactSizeIterator

§

fn entities(&self) -> impl ExactSizeIterator

§

impl TriggerTargets for Vec<Entity>

§

fn components(&self) -> impl ExactSizeIterator

§

fn entities(&self) -> impl ExactSizeIterator

§

impl<const N: usize> TriggerTargets for [ComponentId; N]

§

fn components(&self) -> impl ExactSizeIterator

§

fn entities(&self) -> impl ExactSizeIterator

§

impl<const N: usize> TriggerTargets for [Entity; N]

§

fn components(&self) -> impl ExactSizeIterator

§

fn entities(&self) -> impl ExactSizeIterator

Implementors§