pchickey opened PR #1470 from pch/wiggle_error_model
to master
:
These changes are required for use by Lucet downstream, so that Lucet can use its own Ctx type with the
wasi-common::witx::types
.
Change the
GuestErrorType
trait to drop the associated Ctx type and have just one methodfn success() -> Self
. Like before, this is required for giving the right ABI return value for e.g. anErrno::Ok
after a trait method with signatureResult<A, Errno>
returns anOk(A{...})
.Emit a new trait
GuestErrorConversion
in thetypes
module. This trait gets implemented for any Ctx type that needs to be responsible for transforming aGuestError
into a type used as a witx error type (e.g.Errno
)Together, these two traits encapsulate the same functionality as previously found in
GuestErrorType
, but by splitting the conversion into a separate trait, we can implement it for many Ctx types, rather than restrict it to just the Ctx given at the invocation of thewiggle::from_witx
macro.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
pchickey requested alexcrichton for a review on PR #1470.
alexcrichton submitted PR Review.
kubkon submitted PR Review.
kubkon submitted PR Review.
kubkon created PR Review Comment:
I guess
fn error_types()
is a new method and requires FF onWASI
submodule?
pchickey updated PR #1470 from pch/wiggle_error_model
to master
:
These changes are required for use by Lucet downstream, so that Lucet can use its own Ctx type with the
wasi-common::witx::types
.
Change the
GuestErrorType
trait to drop the associated Ctx type and have just one methodfn success() -> Self
. Like before, this is required for giving the right ABI return value for e.g. anErrno::Ok
after a trait method with signatureResult<A, Errno>
returns anOk(A{...})
.Emit a new trait
GuestErrorConversion
in thetypes
module. This trait gets implemented for any Ctx type that needs to be responsible for transforming aGuestError
into a type used as a witx error type (e.g.Errno
)Together, these two traits encapsulate the same functionality as previously found in
GuestErrorType
, but by splitting the conversion into a separate trait, we can implement it for many Ctx types, rather than restrict it to just the Ctx given at the invocation of thewiggle::from_witx
macro.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
pchickey submitted PR Review.
pchickey created PR Review Comment:
Yes, that was added in 0.8.5. In my haste I forgot to add that commit.
pchickey requested kubkon for a review on PR #1470.
pchickey updated PR #1470 from pch/wiggle_error_model
to master
:
These changes are required for use by Lucet downstream, so that Lucet can use its own Ctx type with the
wasi-common::witx::types
.
Change the
GuestErrorType
trait to drop the associated Ctx type and have just one methodfn success() -> Self
. Like before, this is required for giving the right ABI return value for e.g. anErrno::Ok
after a trait method with signatureResult<A, Errno>
returns anOk(A{...})
.Emit a new trait
GuestErrorConversion
in thetypes
module. This trait gets implemented for any Ctx type that needs to be responsible for transforming aGuestError
into a type used as a witx error type (e.g.Errno
)Together, these two traits encapsulate the same functionality as previously found in
GuestErrorType
, but by splitting the conversion into a separate trait, we can implement it for many Ctx types, rather than restrict it to just the Ctx given at the invocation of thewiggle::from_witx
macro.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
pchickey merged PR #1470.
Last updated: Dec 23 2024 at 12:05 UTC