Skip to main content

ReactEvent

Trait ReactEvent 

Source
pub trait ReactEvent:
    Serialize
    + TS
    + Send
    + Sync
    + 'static {
    const NAME: &'static str;
}
Expand description

A typed payload Bevy sends to React as a named event. Out-only — it is never deserialized on the Rust side, so it derives Serialize (not Deserialize).

Usually derived with #[react_event].

Required Associated Constants§

Source

const NAME: &'static str

The event name React listens for, e.g. "user.disconnected". Defaults to the struct ident with its first letter lowercased.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§