| Crates.io | reflect-steroids |
| lib.rs | reflect-steroids |
| version | 0.2.0 |
| created_at | 2022-08-12 10:49:40.718605+00 |
| updated_at | 2022-08-25 12:06:03.104236+00 |
| description | Extensions for bevy_reflect enabling reflection through arbitrary trait objects |
| homepage | https://docs.rs/reflect-steroids/latest/reflect_steroids |
| repository | https://github.com/simonask/reflect-steroids |
| max_upload_size | |
| id | 643946 |
| size | 88,592 |
A series of supplementary extensions to the
bevy_reflect crate that powers aspects of the
Bevy game engine.
bevy_reflect provides is a general reflection framework for Rust structs, with
rudimentary support for traits.
bevy_reflect.TypeRegistry::register(). This feature is gated behind the "inventory" crate
feature, enabled by default. See [enable_global_type_registration].dynamic_cast). See the
[Cast] trait.downcast-rs, but
using the
Reflect
trait instead of
Any. See
[DowncastReflect].typetag).This crate provides a much more intuitive and user-friendly way of interacting with reflected types through arbitrary trait objects.
By implementing [DynamicTrait] for dyn MyTrait, reflection is made available
to all dynamic trait object references of that type. The only requirements are
that the trait has [DowncastReflect] as a supertrait, and that a call to the
macro impl_dynamic_trait!(MyTrait, ReflectMyTrait) is
present in the code.