2020-08-29 00:08:51 +00:00
|
|
|
[package]
|
|
|
|
name = "bevy_utils"
|
2022-04-17 23:04:52 +00:00
|
|
|
version = "0.8.0-dev"
|
2021-10-27 00:12:14 +00:00
|
|
|
edition = "2021"
|
2020-08-29 00:08:51 +00:00
|
|
|
description = "A collection of utils for Bevy Engine"
|
|
|
|
homepage = "https://bevyengine.org"
|
|
|
|
repository = "https://github.com/bevyengine/bevy"
|
2021-07-23 21:11:51 +00:00
|
|
|
license = "MIT OR Apache-2.0"
|
2020-08-29 00:08:51 +00:00
|
|
|
keywords = ["bevy"]
|
|
|
|
|
|
|
|
[dependencies]
|
2021-02-01 21:29:54 +00:00
|
|
|
ahash = "0.7.0"
|
2022-04-27 19:08:11 +00:00
|
|
|
tracing = { version = "0.1", default-features = false, features = ["std"] }
|
2020-11-22 00:38:24 +00:00
|
|
|
instant = { version = "0.1", features = ["wasm-bindgen"] }
|
2022-05-30 17:26:23 +00:00
|
|
|
uuid = { version = "1.1", features = ["v4", "serde"] }
|
2022-06-17 22:34:58 +00:00
|
|
|
hashbrown = { version = "0.12", features = ["serde"] }
|
Simplify design for `*Label`s (#4957)
# Objective
- Closes #4954
- Reduce the complexity of the `{System, App, *}Label` APIs.
## Solution
For the sake of brevity I will only refer to `SystemLabel`, but everything applies to all of the other label types as well.
- Add `SystemLabelId`, a lightweight, `copy` struct.
- Convert custom types into `SystemLabelId` using the trait `SystemLabel`.
## Changelog
- String literals implement `SystemLabel` for now, but this should be changed with #4409 .
## Migration Guide
- Any previous use of `Box<dyn SystemLabel>` should be replaced with `SystemLabelId`.
- `AsSystemLabel` trait has been modified.
- No more output generics.
- Method `as_system_label` now returns `SystemLabelId`, removing an unnecessary level of indirection.
- If you *need* a label that is determined at runtime, you can use `Box::leak`. Not recommended.
## Questions for later
* Should we generate a `Debug` impl along with `#[derive(*Label)]`?
* Should we rename `as_str()`?
* Should we remove the extra derives (such as `Hash`) from builtin `*Label` types?
* Should we automatically derive types like `Clone, Copy, PartialEq, Eq`?
* More-ergonomic comparisons between `Label` and `LabelId`.
* Move `Dyn{Eq, Hash,Clone}` somewhere else.
* Some API to make interning dynamic labels easier.
* Optimize string representation
* Empty string for unit structs -- no debug info but faster comparisons
* Don't show enum types -- same tradeoffs as asbove.
2022-07-14 18:23:01 +00:00
|
|
|
concat-idents = "1"
|
2020-10-21 22:55:35 +00:00
|
|
|
|
|
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
2022-06-17 22:34:58 +00:00
|
|
|
getrandom = {version = "0.2.0", features = ["js"]}
|