mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
89cbc78d3d
# Objective Be consistent with `Resource`s and `Components` and have `Event` types be more self-documenting. Although not susceptible to accidentally using a function instead of a value due to `Event`s only being initialized by their type, much of the same reasoning for removing the blanket impl on `Resource` also applies here. * Not immediately obvious if a type is intended to be an event * Prevent invisible conflicts if the same third-party or primitive types are used as events * Allows for further extensions (e.g. opt-in warning for missed events) ## Solution Remove the blanket impl for the `Event` trait. Add a derive macro for it. --- ## Changelog - `Event` is no longer implemented for all applicable types. Add the `#[derive(Event)]` macro for events. ## Migration Guide * Add the `#[derive(Event)]` macro for events. Third-party types used as events should be wrapped in a newtype. |
||
---|---|---|
.. | ||
button.rs | ||
flex_layout.rs | ||
font_atlas_debug.rs | ||
grid.rs | ||
overflow.rs | ||
overflow_debug.rs | ||
relative_cursor_position.rs | ||
size_constraints.rs | ||
text.rs | ||
text_debug.rs | ||
text_wrap_debug.rs | ||
transparency_ui.rs | ||
ui.rs | ||
ui_scaling.rs | ||
window_fallthrough.rs | ||
z_index.rs |