bevy/crates/bevy_render/src
JaySpruce ee44560523
Add EntityDoesNotExistError, replace cases of Entity as an error, do some easy Resultification (#17855)
## Objective
There's no general error for when an entity doesn't exist, and some
methods are going to need one when they get Resultified. The closest
thing is `EntityFetchError`, but that error has a slightly more specific
purpose.

## Solution
- Added `EntityDoesNotExistError`.
  - Contains `Entity` and `EntityDoesNotExistDetails`.
- Changed `EntityFetchError` and `QueryEntityError`:
- Changed `NoSuchEntity` variant to wrap `EntityDoesNotExistError` and
renamed the variant to `EntityDoesNotExist`.
- Renamed `EntityFetchError` to `EntityMutableFetchError` to make its
purpose clearer.
- Renamed `TryDespawnError` to `EntityDespawnError` to make it more
general.
- Changed `World::inspect_entity` to return `Result<[ok],
EntityDoesNotExistError>` instead of panicking.
- Changed `World::get_entity` and `WorldEntityFetch::fetch_ref` to
return `Result<[ok], EntityDoesNotExistError>` instead of `Result<[ok],
Entity>`.
- Changed `UnsafeWorldCell::get_entity` to return
`Result<UnsafeEntityCell, EntityDoesNotExistError>` instead of
`Option<UnsafeEntityCell>`.

## Migration Guide
- `World::inspect_entity` now returns `Result<impl Iterator<Item =
&ComponentInfo>, EntityDoesNotExistError>` instead of `impl
Iterator<Item = &ComponentInfo>`.
- `World::get_entity` now returns `EntityDoesNotExistError` as an error
instead of `Entity`. You can still access the entity's ID through the
error's `entity` field.
- `UnsafeWorldCell::get_entity` now returns `Result<UnsafeEntityCell,
EntityDoesNotExistError>` instead of `Option<UnsafeEntityCell>`.
2025-02-16 21:59:46 +00:00
..
batching Replace BufferVec<PreprocessWorkItem> with RawBufferVec<PreprocessWorkItem>. (#17862) 2025-02-16 19:59:29 +00:00
camera Introduce methods on QueryState to obtain a Query (#15858) 2025-02-05 18:33:15 +00:00
diagnostic Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
experimental Add user supplied mesh tag (#17648) 2025-02-10 22:38:13 +00:00
mesh Don't relocate the meshes when mesh slabs grow. (#17793) 2025-02-11 22:38:26 +00:00
primitives Support non-Vec data structures in relations (#17447) 2025-01-20 21:26:08 +00:00
render_graph Implement experimental GPU two-phase occlusion culling for the standard 3D mesh pipeline. (#17413) 2025-01-27 05:02:46 +00:00
render_phase Add EntityDoesNotExistError, replace cases of Entity as an error, do some easy Resultification (#17855) 2025-02-16 21:59:46 +00:00
render_resource Use target_abi = "sim" instead of ios_simulator feature (#17702) 2025-02-11 23:01:26 +00:00
renderer Use unchecked shaders for better performance (#17767) 2025-02-12 06:16:52 +00:00
texture Allowed creating uninitialized images (for use as storage textures) (#17760) 2025-02-10 22:22:07 +00:00
view Upgrade to wgpu v24 (#17542) 2025-02-09 19:40:53 +00:00
alpha.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
color_operations.wgsl move wgsl color operations from bevy_pbr to bevy_render (#13209) 2024-05-04 10:30:23 +00:00
extract_component.rs Improved Spawn APIs and Bundle Effects (#17521) 2025-02-09 23:32:56 +00:00
extract_instances.rs Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
extract_param.rs Implement WorldQuery for MainWorld and RenderWorld components (#15745) 2024-10-13 20:58:46 +00:00
extract_resource.rs Fix "Unrecognized Option" error when using Criterion-specific arguments in benchmarks (#17222) 2025-01-08 00:09:31 +00:00
globals.rs Weak handle migration (#17695) 2025-02-05 22:44:20 +00:00
globals.wgsl Refactor Globals and View structs into separate shaders (#7512) 2023-02-11 17:55:18 +00:00
gpu_component_array_buffer.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
gpu_readback.rs Upgrade to wgpu v24 (#17542) 2025-02-09 19:40:53 +00:00
lib.rs Build batches across phases in parallel. (#17764) 2025-02-13 00:02:20 +00:00
maths.wgsl Atmosphere LUT parameterization improvements (#17555) 2025-02-03 21:52:11 +00:00
pipelined_rendering.rs Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
render_asset.rs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
settings.rs Upgrade to wgpu v24 (#17542) 2025-02-09 19:40:53 +00:00
storage.rs Add a bindless mode to AsBindGroup. (#16368) 2024-12-03 18:00:34 +00:00
sync_component.rs Refactored ComponentHook Parameters into HookContext (#17503) 2025-01-23 02:45:24 +00:00
sync_world.rs Retain bins from frame to frame. (#17698) 2025-02-08 20:13:33 +00:00