-
Notifications
You must be signed in to change notification settings - Fork 139
Unify HostFunctionXX traits into a single HostFunction #464
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
Conversation
db41478
to
e942802
Compare
Signed-off-by: Jorge Prendes <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
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.
Pull Request Overview
This PR unifies the previously separate HostFunctionXX traits into a single HostFunction trait for host function registration. The key changes include updating imports, function parameters, and macro implementations, resulting in a more streamlined API across tests, examples, and the core host function implementation.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/hyperlight_host/tests/sandbox_host_tests.rs | Updated import from HostFunction1 to HostFunction. |
src/hyperlight_host/tests/common/mod.rs | Replaced HostFunction1 with HostFunction in function parameters. |
src/hyperlight_host/src/sandbox/uninitialized.rs | Updated host function parameter types from HostFunction1 to HostFunction. |
src/hyperlight_host/src/func/mod.rs | Removed re-exports for legacy HostFunctionXX traits and exposed HostFunction. |
src/hyperlight_host/src/func/host_functions.rs | Revised macro implementation to support the unified HostFunction trait. |
src/hyperlight_host/src/func/guest_dispatch.rs | Updated import from HostFunction0 to HostFunction. |
Examples and benches | Updated usage of HostFunction trait consistently in place of earlier HostFunctionX versions. |
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.
LGTM
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.
Great work @jprendes
This PR removes the HostFunctionXX traits, and replaces them with a single HostFunction trait.