Add Engine::detect_precompiled_file()#6937
Conversation
This is handy for users of `deserialize_file()` to determine which version to call.
|
I'm handing review of this off to Alex as the author of the API you're extending. I had hoped that the |
Subscribe to Label Actioncc @peterhuene DetailsThis issue or pull request has been labeled: "wasmtime:api"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
alexcrichton
left a comment
There was a problem hiding this comment.
Seems reasonable to me, thanks!
I had hoped that the
from_trusted_fileentry-point or similar would suffice to avoid embedders needing to detect for themselves whether they were holding on to a precompiled module
Ah yeah I tried to use this when I originally refactored the CLI to take components, but the main reason I couldn't use it was that the CLI needed to dispatch to either Component::deserialize or Module::deserialize depending on what the compiled bytes were. I initially hoped to avoid ModuleOrComponent in the wasmtime crate's API but I think from_trusted_file would work there.
Overall at least from the CLI I felt that our API for loading modules/components is still kinda clunky. I couldn't really figure out a better replacement though so I gave up and added detect_precompiled. I'm definitely all-ears though for other suggestions!
|
I'm still getting acquainted with the component side of the crate API, but it seems like a |
This is handy for users of `deserialize_file()` to determine which version to call.
This is handy for users of
deserialize_file()to determine which version to call.