EmbarkStudios / mirror-mirror

🪞 Powerful reflection library for Rust
Apache License 2.0
79 stars 2 forks source link

Keep type name for opaque types #20

Closed davidpdrsn closed 1 year ago

davidpdrsn commented 1 year ago

There isn't really a good way to represent types like Duration, since we cannot access its inner data. So Duration::type_info() returns Opaque. Previously Opaque didn't have any associated data so you had no way of knowing which type it actually was.

This changes that so the type name is preserved. Then you can at least figure out that the type name is core::time::Duration which might help downcasting or calling FromReflect.