Skip to content

Static type introspection #4504

Closed
Closed
@IcyDefiance

Description

@IcyDefiance

What problem does this solve or what need does it fill?

It would be nice if I could get the names and types of fields in a struct, without creating an instance of that struct.

What solution would you like?

Static methods on Struct, Tuple, etc.

What alternative(s) have you considered?

I could probably make my own macro to get just the info I need. It just feels like this is something that should be in a more general-purpose reflection crate.

Additional context

My personal use case was an experimental entity-first ORM. I was hoping to use bevy_reflect to help generate migrations, but I needed this feature to make it work that way.

I already scrapped that whole idea in favor of a headless CMS, but I'm sure this would be useful for others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ReflectionRuntime information about typesC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions