How to pass Vec<u8> to WASM and back? #3466
Unanswered
matthiasbeyer
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am trying to implement a tool that needs to "map" bytes to bytes. That mapping should be written in Rust or any other WASM-compatible language (for now only Rust is fine) and essentially be a
fn(Vec<u8>) -> Vec<u8>
orfn(Vec<u8>) -> Result<Vec<u8>, ()>
.Following the tutorial for having a function
add(i32) -> i32
was pretty easy, but the step up to the above is not.Can someone point me to the right documentation for that? All examples for wasmer only come with WAT, which does not help me at all. I don't even know what the right way for doing this is? Should I allocate host memory for that? VM memory? Is there some other way?
Beta Was this translation helpful? Give feedback.
All reactions