https://github.com/multirious/epic_bevy_remote_reflection
Implement `bevy_reflect`'s `Reflect` trait for remote type, bypassing the orphan rule by editing trait-object's virtual table at runtime and without changes to `bevy_reflect`!
https://github.com/multirious/epic_bevy_remote_reflection
Last synced: 5 months ago
JSON representation
Implement `bevy_reflect`'s `Reflect` trait for remote type, bypassing the orphan rule by editing trait-object's virtual table at runtime and without changes to `bevy_reflect`!
- Host: GitHub
- URL: https://github.com/multirious/epic_bevy_remote_reflection
- Owner: Multirious
- License: apache-2.0
- Created: 2024-08-03T17:22:29.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-05T12:15:15.000Z (almost 2 years ago)
- Last Synced: 2025-04-05T09:16:22.353Z (about 1 year ago)
- Language: Rust
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# epic_bevy_remote_reflection
Implement `bevy_reflect`'s `Reflect` trait for remote type, bypassing the orphan
rule by editing trait-object's virtual table at runtime. No changes needed to `bevy_reflect`.
# Unsafe, do not use for production! (winked)
I only created this for fun.
Rust doesn't have a guarantee that the underlying virtual table memory layout will
stays the same between Rust releases. It's a part of the compiler, not the language.
So be aware of changes and untested versions!
Tested versions:
- `1.80`
https://geo-ant.github.io/blog/2023/rust-dyn-trait-objects-fat-pointers/