feat: impl LongRefFromWasmAbi for T where T: Tsify + FromWasmAbi #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement #34
I tried to make a test of the behavior by building a test very similar to #33 using async function for
validate
and it fails 😧...which is expected because Rust must be responsible for dropping the reference to the closure here so you cannot invoke the closure twice and we have no way to check it in Rust according to rustwasm/wasm-bindgen#3178 so this suggest my implementation is right actually 😃 ...
But it also fails if I use the same implementation as
RefFromWasmAbi
for theLongRefFromWasmAbi
😧, which normally does not drop the reference at the end of the first Rust invocation and so allow the second invocation to be processed.In summary, I am not sure how to test that my implementation is the correct one 😕
I leave this PR here for people who are maybe more knowledgeable building a test for this. My main issue is that we cannot take an async closure as function argument to reproduce a test like in aaaa398 where
validation
isasync