Type-safe API to query Godot features
- Dominant language
- Rust
- Stars
- 5.2k
- Forks
- 312
- Avg merge
- 12h 59m
- Merged PRs (30d)
- 9
Description
We already have the [`GdextBuild`](https://godot-rust.github.io/docs/gdext/master/godot/init/struct.GdextBuild.html) class which gives access to API and runtime versions.
There are more capabilities that can be queried, e.g. using [`OS::has_feature()`](https://docs.godotengine.org/en/stable/classes/class_os.html#class-os-method-has-feature).
The [feature tags](https://docs.godotengine.org/en/stable/tutorials/export/feature_tags.html) are however stringly typed, and it would be nice to have a type-safe API. Instead of a single enum grouping all values, we could categorize features into multiple specific enums. The docs contain a bullet list:
> Godot has a special system to tag availability of features. Each feature is represented as a string, which can refer to many of the following:
> - Platform name.
> - Platform architecture (64-bit or 32-bit, x86 or ARM).
> - Platform type (desktop, mobile, Web).
> - Supported texture compression algorithms on the platform.
> - Whether a build is debug or release (debug includes the editor).
> - Whether the project is running from the editor or a "standalone" binary.
> - Many more things.
We would need to make sure that enum variants are truly exclusive, otherwise we'd need to model things differently. Knowing the exact semantics may require some research.
Contributor guide
Assessment
This issue has not been assessed yet.