alexcrichton opened PR #1480 from linker-get
to master
:
This commit adds three new methods to
Linker
in order to inspect it
after values have been inserted:
Linker::iter
- iterates over all defined valuesLinker::get
- lookup a value by itsImportType
Linker::get_by_name
- lookup values based on their nameCloses #1454
sunfishcode submitted PR Review.
sunfishcode submitted PR Review.
sunfishcode created PR Review Comment:
Could we factor this out into a method on
Linker
, something likeself.linker.get_one_by_name(module, name)
or so? I realize it'll require a special error type to be able to report both "no item named {}" and "too many items named {}", but this seems like it'll be a common use case -- I'm even picturing something like the wasmtime CLI but backed by a Linker so that you can provide multiple modules and then do--invoke
.
sunfishcode created PR Review Comment:
Could you add a brief mention of what the components of the tuple return are? Looking at the code, I'm not surprised it's module, name, extern, but it feels like something worth making explicit in the docs.
sunfishcode created PR Review Comment:
yay!
sunfishcode created PR Review Comment:
Could we factor out this logic too, with something like
self.linker.alias(name, as_name)
or so?
alexcrichton updated PR #1480 from linker-get
to master
:
This commit adds three new methods to
Linker
in order to inspect it
after values have been inserted:
Linker::iter
- iterates over all defined valuesLinker::get
- lookup a value by itsImportType
Linker::get_by_name
- lookup values based on their nameCloses #1454
sunfishcode submitted PR Review.
alexcrichton merged PR #1480.
Last updated: Nov 22 2024 at 17:03 UTC