bevy/crates/bevy_ecs/src/storage
Christian Hughes 345f935b1a
Add Trigger::components, which lists the component targets that were triggered (#15811)
# Objective

- Closes #14774 

## Solution

Added:

```rust
impl<'w, E, B: Bundle> Trigger<'w, E, B> {
    pub fn components(&self) -> &[ComponentId];
}
```

I went with storing it in the trigger as a `SmallVec<[Component; 1]>`
because a singular target component will be the most common case, and it
remains the same size as `Vec<ComponentId>`.

## Testing

Added a test.
2024-10-15 02:17:03 +00:00
..
table Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
blob_array.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
blob_vec.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
mod.rs Remove redundent information and optimize dynamic allocations in Table (#12929) 2024-09-16 22:52:05 +00:00
resource.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
sparse_set.rs Add Trigger::components, which lists the component targets that were triggered (#15811) 2024-10-15 02:17:03 +00:00
thin_array_ptr.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00