You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately the ? operator required From to be implemented, not Into. I don't know why this was chosen by Rust but I don't think it will change any time soon.
Would it be possible to require Into<RuntimeError> instead of RuntimeError in the callback like this:
// VmError is my custom errorimplFrom<VmError>for wasmer_engine::RuntimeError{fnfrom(original:VmError) -> wasmer_engine::RuntimeError{let msg:String = original.to_string();
wasmer_engine::RuntimeError::new(msg)}}
I was not expecting to be able to implement for a foreign type, but it works. From my side this can be closed, but since you assigned yourself, @MarkMcCaskey, do you have additional thoughts?
@webmaster128 Oh, that's great to hear! If it's solved on your end then I think it's good, I thought there might be another issue here but I just checked and it doesn't seem to be an issue.
I'll close this then. Feel free to reopen it if other issues come up
I'm trying to port an import implementation to Wasmer Reborn. What I have so far is:
where
do_read
returns acore::result::Result<u32, VmError>
. Now I implementedFrom<T> for U
impliesInto<U> for T
but not the other way round.Unfortunately the ? operator required
From
to be implemented, notInto
. I don't know why this was chosen by Rust but I don't think it will change any time soon.Would it be possible to require
Into<RuntimeError>
instead ofRuntimeError
in the callback like this:Any other ideas how to deal with such use cases? In our old code, Wasmer did not care about the error type in the callback's
Result
.The text was updated successfully, but these errors were encountered: