bevy/crates/bevy_ecs/src/observer
Carter Anderson 0daa6c510b
Make Observer::with_event (and other variants) unsafe (#13954)
# Objective

`with_event` will result in unsafe casting of event data of the given
type to the type expected by the Observer system. This is inherently
unsafe.

## Solution

Flag `Observer::with_event` and `ObserverDescriptor::with_events` as
unsafe. This will not affect normal workflows as `with_event` is
intended for very specific (largely internal) use cases.

This _should_ be backported to 0.14 before release.

---

## Changelog

- `Observer::with_event` is now unsafe.
- Rename `ObserverDescriptor::with_triggers` to
`ObserverDescriptor::with_events` and make it unsafe.
2024-06-21 18:31:01 +00:00
..
entity_observer.rs Generalised ECS reactivity with Observers (#10839) 2024-06-15 01:33:26 +00:00
mod.rs Make Observer::with_event (and other variants) unsafe (#13954) 2024-06-21 18:31:01 +00:00
runner.rs Make Observer::with_event (and other variants) unsafe (#13954) 2024-06-21 18:31:01 +00:00
trigger_event.rs Generalised ECS reactivity with Observers (#10839) 2024-06-15 01:33:26 +00:00