-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand Constant to allow getting its Type #279
Comments
Thanks for the issue and for the PR.
Thanks, it certainly tries to 😄 If you don't mind sharing, I'm curious to hear more! How did you come across this crate? What's the use case you are targeting? |
tldr: I wanted to parse Windows_sys crate for its constants (names/values), started with a cargo-semver-checks crate and after some digging through sparse docs and code realized that this adapter is the one providing all the schema descriptions A bit more context: I wanted to have a more ergonomic way to use Windows constants to call Windows APIs in a scripting language:
Given that there are >100k constants, I couldn't load them dynamically within the language itself, so I thought I'd write a Rust library that stores all the values and returns them from a constant name. Found the Windows_sys crate that has all the contants, realized there is no reflection in Rust (so I can't just compile the crate and ask it to list all the contants), but someone at the Rust language forums suggested to look at cargo-semver-checks which parses cargo docs that contains that information. So I've looked at the |
I'd like to get a list of all of crate's constants with their type and values, the latest changes allowed getting the values, but still not Type.
There is a workaround you suggested using Constant ID to find the required information, but it'd be nicer to be able to use the query language for that
You mentioned that this is pending Trustfall support for types
The text was updated successfully, but these errors were encountered: