bevy/crates/bevy_ecs/src
BigWingBeat e7c14bd06b
Add EntityWorldMut::(try_)resource_scope (#20162)
# Objective

Fixes #20139

## Solution

Implement the methods, and leverage them where applicable

## Testing

Added unit tests

---

## Showcase

```rust
let id = entity_world_mut.id();
let world = entity_world_mut.into_world_mut();
world.resource_scope::<_, _>(|world, res| {
    let entity_world_mut = world.entity_mut(id);
    /* ... */
});
```

becomes

```rust
entity_world_mut.resource_scope::<_, _>(|entity, res| {
    /* ... */
});
```
2025-07-16 17:37:25 +00:00
..
bundle allow EntityCloner to move components without Clone or Reflect (#20065) 2025-07-14 22:33:01 +00:00
component allow EntityCloner to move components without Clone or Reflect (#20065) 2025-07-14 22:33:01 +00:00
entity allow EntityCloner to move components without Clone or Reflect (#20065) 2025-07-14 22:33:01 +00:00
error Don't create errors for ignored failed commands (#19718) 2025-06-29 16:34:20 +00:00
event Add EntityWorldMut::(try_)resource_scope (#20162) 2025-07-16 17:37:25 +00:00
observer Remove the need to derive Event when deriving EntityEvent (#20104) 2025-07-15 16:45:38 +00:00
query Have System::run_unsafe return Result. (#19145) 2025-07-03 21:48:09 +00:00
reflect Add EntityWorldMut::(try_)resource_scope (#20162) 2025-07-16 17:37:25 +00:00
relationship allow EntityCloner to move components without Clone or Reflect (#20065) 2025-07-14 22:33:01 +00:00
schedule Improve node encapsulation in ScheduleGraph (#20119) 2025-07-15 06:29:52 +00:00
storage Bump typos to 1.34.0 (#20013) 2025-07-07 20:15:06 +00:00
system ReadOnlySystem diagnostics and type alias (#19138) 2025-07-15 00:14:06 +00:00
world Add EntityWorldMut::(try_)resource_scope (#20162) 2025-07-16 17:37:25 +00:00
archetype.rs Bump typos to 1.34.0 (#20013) 2025-07-07 20:15:06 +00:00
batching.rs Nonmax all rows (#19132) 2025-05-26 17:39:55 +00:00
change_detection.rs Split BufferedEvent from Event (#20101) 2025-07-14 21:31:48 +00:00
entity_disabling.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
hierarchy.rs Add parent ID to the B0004 log message (#19980) 2025-07-07 20:04:59 +00:00
intern.rs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
label.rs Remove upcasting methods + Cleanup interned label code (#18984) 2025-05-26 15:38:12 +00:00
lib.rs Split BufferedEvent from Event (#20101) 2025-07-14 21:31:48 +00:00
lifecycle.rs Remove the need to derive Event when deriving EntityEvent (#20104) 2025-07-15 16:45:38 +00:00
name.rs Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
never.rs Use never_say_never hack to work around Rust 2024 regression for fn traits (#18804) 2025-04-14 19:59:48 +00:00
resource.rs refactor(utils): move SyncCell and SyncUnsafeCell to bevy_platform (#19305) 2025-05-27 04:57:26 +00:00
spawn.rs Remove Bundle::register_required_components (#19967) 2025-07-06 18:15:28 +00:00
traversal.rs Let query items borrow from query state to avoid needing to clone (#15396) 2025-06-16 21:05:41 +00:00