-
Notifications
You must be signed in to change notification settings - Fork 19
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
Support fetching imports from a Module #372
Support fetching imports from a Module #372
Conversation
ext/src/ruby_api/module.rs
Outdated
let hash = RHash::new(); | ||
hash.aset("module", import.module())?; | ||
hash.aset("name", import.name())?; | ||
hash.aset("type", format!("{:?}", import.ty()))?; |
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.
I'm not sure we want to return a string for the type, ideally we'd want a proper type representing the extern. I believe you can use https://github.com/bytecodealliance/wasmtime-rb/blob/main/ext/src/ruby_api/externals.rs#L110
65015be
to
5179dd9
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.
Looks good to me; there are couple of docs that need updating and after we should be able to land this one.
ext/src/ruby_api/externals.rs
Outdated
/// @yard | ||
/// Returns the exported function's FuncType or raises a `{ConversionError}` when the export is not a | ||
/// function. | ||
/// @return [Func] The exported function. |
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.
I believe here it should be
@return [FuncType]
In the signatures below as well?
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.
Good catch! Fixed.
Add support for fetching the list of Module imports.