bevy_ecs::observer

Trait TriggerTargets

Source
pub trait TriggerTargets {
    // Required methods
    fn components(&self) -> &[ComponentId];
    fn entities(&self) -> &[Entity];
}
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§

Source

fn components(&self) -> &[ComponentId]

The components the trigger should target.

Source

fn entities(&self) -> &[Entity]

The entities the trigger should target.

Implementations on Foreign Types§

Source§

impl TriggerTargets for &Vec<Entity>

Source§

fn components(&self) -> &[ComponentId]

Source§

fn entities(&self) -> &[Entity]

Source§

impl TriggerTargets for ()

Source§

fn components(&self) -> &[ComponentId]

Source§

fn entities(&self) -> &[Entity]

Source§

impl TriggerTargets for Vec<ComponentId>

Source§

fn components(&self) -> &[ComponentId]

Source§

fn entities(&self) -> &[Entity]

Source§

impl TriggerTargets for Vec<Entity>

Source§

fn components(&self) -> &[ComponentId]

Source§

fn entities(&self) -> &[Entity]

Source§

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

Source§

fn components(&self) -> &[ComponentId]

Source§

fn entities(&self) -> &[Entity]

Source§

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

Source§

fn components(&self) -> &[ComponentId]

Source§

fn entities(&self) -> &[Entity]

Implementors§