-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
In non-rust bindings where Rust Enum inspection is not present it is difficult to understand which Expr variant you are interacting with. It would be much easier for bindings, Python for example, to have the ability to invoke a function on an Expr variant instance and be returned a String representation of that variant. Something like variant_name() -> &str
Describe the solution you'd like
Function added to Expr that returns a &str representation of the current variant represented by the Expr instance the function is called on.
Describe alternatives you've considered
Thought about using Macros and adding similar blanket coverage for all instance types but that seems too heavy and I personally find heavy macro use unclear.
Additional context
PyO3 is a popular binding library for Python and Rust. There is currently no support for directly introspecting Rust Enums and hence why this change would be nice to have.