bevy/crates/bevy_reflect/src
SpecificProtagonist b2d3371814
Event source location tracking (#16778)
# Objective

Fixes #16776

## Solution

- reflect `&'static Location` as an opaque type
- I've added this to `impls/std.rs` because other core types are there
too. Maybe they should be split out into a `core.rs` in another PR.
- add source location to `EventId` (behind the
`tracking_change_detection` feature flag)

## Testing

---

## Showcase
```rust
fn apply_damage_to_health(
    mut dmg_events: EventReader<DealDamage>,
) {
    for (event, event_id) in dmg_events.read_with_id() {
        info!(
            "Applying {} damage, triggered by {}",
            event.amount, event_id.caller
        );
…
```
```
2024-12-12T01:21:50.126827Z  INFO event: Applying 9 damage, triggered by examples/ecs/event.rs:47:16
```

## Migration Guide

- If you manually construct a `SendEvent`, use `SendEvent::new()`

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2024-12-12 18:12:53 +00:00
..
enums Deny derive_more error feature and replace it with thiserror (#16684) 2024-12-06 17:03:55 +00:00
func Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00
impls Event source location tracking (#16778) 2024-12-12 18:12:53 +00:00
path Deny derive_more error feature and replace it with thiserror (#16684) 2024-12-06 17:03:55 +00:00
serde Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00
array.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
attributes.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
fields.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
from_reflect.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
generics.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
kind.rs Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00
lib.rs Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00
list.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
map.rs Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00
reflect.rs ✏️ Fix typos across bevy (#16702) 2024-12-08 01:18:39 +00:00
reflectable.rs bevy_reflect: Add Reflectable trait (#5772) 2024-09-18 00:36:41 +00:00
remote.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
set.rs Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00
std_traits.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
struct_trait.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
tuple_struct.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
tuple.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
type_info_stack.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
type_info.rs Deny derive_more error feature and replace it with thiserror (#16684) 2024-12-06 17:03:55 +00:00
type_path.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
type_registry.rs Add no_std support to bevy_reflect (#16256) 2024-12-05 21:15:21 +00:00
utility.rs Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00