-
Notifications
You must be signed in to change notification settings - Fork 219
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
Add Types{,Ref}::{imports,exports} getters #806
base: main
Are you sure you want to change the base?
Add Types{,Ref}::{imports,exports} getters #806
Conversation
Seems reasonable to me to add! Could the return values here though be an |
Oh, I was hoping to use it as an IndexMap; ModuleType/ComponentType also have |
Or an |
Or actually it's not even really an IndexMap at all, is it? Internal representation should be more something like |
Ok I know that's like, a whole new datastructure I just added, but it's really just a simple wrapper around a hashtable (or, simple if you know how hashmaps work, at least) |
1496585
to
63c0e1c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, but sorry to clarify I dont think that this necessarily needs a whole new data structure. I was instead thinking that an -> impl Iterator<...>
could be returned which internally did something like a .flat_map(..)
to get hte flat iterator.
Yeah, the RawTable probably was a little bit overkill... but I was thinking that since the full IndexMaps were exposed for the other methods, it'd make sense to have at least something with |
I do think that iteration order here will be important and should match what was specified in the original module. I forgot that |
I'm not sure if there was a reason this wasn't a thing, but afaict
validator::core::exports::Module::exports/imports
is never accessed to get() at one of their entries, only ever to insert stuff into them. This seems like a missing piece of the API, sorta.