ChannelTriggerApp

Trait ChannelTriggerApp 

Source
pub trait ChannelTriggerApp {
    // Required method
    fn add_channel_trigger<T: Event>(&mut self) -> ChannelSender<T>;
}
Expand description

Extension to Bevy App that allows ergonomic creation of the channel

Required Methods§

Source

fn add_channel_trigger<T: Event>(&mut self) -> ChannelSender<T>

Spawns a channel registers the receiver as a resource and returns the ChannelSender<T> This sender can be used from anywhere to send events into the Bevy world. These triggers can be subscribed to via app.observe.

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.

Implementations on Foreign Types§

Source§

impl ChannelTriggerApp for App

Implementors§