mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
6d25545c51
# Objective - Make `Result<T, E>` implement Reflect such that it is an Enum rather than a Value - Fixes #13178 ## Solution - Use the correct macro ## Testing - Did you test these changes? I tried it out locally, and it does what it says on the tin. Not sure how to test it in context of the crate? --- ## Changelog ### Changed - Result now uses `ReflectKind::Enum` rather than `ReflectKind::Value`, allowing for inspection of its constituents ## Migration Guide `Result<T, E>` has had its `Reflect` implementation changed to align it with `Option<T>` and its intended semantics: A carrier of either an `Ok` or `Err` value, and the ability to access it. To achieve this it is no longer a `ReflectKind::Value` but rather a `ReflectKind::Enum` and as such carries these changes with it: For `Result<T, E>` - Both `T` and `E` no longer require to be `Clone` and now require to be `FromReflect` - `<Result<T, E> as Reflect>::reflect_*` now returns a `ReflectKind::Enum`, so any code that previously relied on it being a `Value` kind will have to be adapted. - `Result<T, E>` now implements `Enum` Since the migration is highly dependent on the previous usage, no automatic upgrade path can be given. Signed-off-by: Marcel Müller <neikos@neikos.email> |
||
---|---|---|
.. | ||
bevy_a11y | ||
bevy_animation | ||
bevy_app | ||
bevy_asset | ||
bevy_audio | ||
bevy_color | ||
bevy_compile_test_utils | ||
bevy_core | ||
bevy_core_pipeline | ||
bevy_derive | ||
bevy_dev_tools | ||
bevy_diagnostic | ||
bevy_dylib | ||
bevy_dynamic_plugin | ||
bevy_ecs | ||
bevy_ecs_compile_fail_tests | ||
bevy_encase_derive | ||
bevy_gilrs | ||
bevy_gizmos | ||
bevy_gltf | ||
bevy_hierarchy | ||
bevy_input | ||
bevy_internal | ||
bevy_log | ||
bevy_macro_utils | ||
bevy_macros_compile_fail_tests | ||
bevy_math | ||
bevy_mikktspace | ||
bevy_pbr | ||
bevy_ptr | ||
bevy_reflect | ||
bevy_reflect_compile_fail_tests | ||
bevy_render | ||
bevy_scene | ||
bevy_sprite | ||
bevy_tasks | ||
bevy_text | ||
bevy_time | ||
bevy_transform | ||
bevy_ui | ||
bevy_utils | ||
bevy_window | ||
bevy_winit |