Skip to content
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

feat: implement ResourceAny -> Resource<T> conversion #7712

Merged

Conversation

rvolosatovs
Copy link
Member

@rvolosatovs rvolosatovs commented Dec 20, 2023

Closes #7704
Follow-up on #7688 (based on that PR for simplicity)

Once #7688 is merged, I'll rebase such that only 5b20daf would be in this PR. Also happy to move the commit to #7688 if you prefer

@rvolosatovs
Copy link
Member Author

cc @alexcrichton

@github-actions github-actions bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Dec 20, 2023
Copy link

Subscribe to Label Action

cc @peterhuene

This issue or pull request has been labeled: "wasmtime:api"

Thus the following users have been cc'd because of the following labels:

  • peterhuene: wasmtime:api

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@rvolosatovs rvolosatovs force-pushed the feat/resource-any-2-resource branch 3 times, most recently from accf39c to 00ca470 Compare December 22, 2023 13:53
@github-actions github-actions bot added the cranelift Issues related to the Cranelift code generator label Dec 22, 2023
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me, thanks!

There's one minor API-design question where it's not possible to recover from this method if it fails due to consumption of the ResourceAny input. That being said the main failure condition, the wrong type, can be tested manually ahead of time, so I think that's ok.

crates/wasmtime/src/component/resources.rs Outdated Show resolved Hide resolved
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
@rvolosatovs rvolosatovs force-pushed the feat/resource-any-2-resource branch from 00ca470 to 6b72f00 Compare January 4, 2024 10:29
@rvolosatovs rvolosatovs marked this pull request as ready for review January 4, 2024 10:30
@rvolosatovs rvolosatovs requested a review from a team as a code owner January 4, 2024 10:30
@rvolosatovs rvolosatovs requested review from pchickey and alexcrichton and removed request for a team January 4, 2024 10:30
@alexcrichton alexcrichton added this pull request to the merge queue Jan 4, 2024
Merged via the queue into bytecodealliance:main with commit ae535f1 Jan 4, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift Issues related to the Cranelift code generator wasmtime:api Related to the API of the `wasmtime` crate itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement ResourceAny -> Resource<T> conversion
2 participants