# Return string form rust in Wasm

**URL:** <https://forum.elixirforum.com/t/return-string-form-rust-in-wasm/51372>\
**Category:** Questions\
**Tags:** rust, wasmex\
**Created:** [October 27, 2022, 8:26am UTC](https://forum.elixirforum.com/t/return-string-form-rust-in-wasm/51372 "2022-10-27T08:26:45Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![echojoys](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/echojoys/32/32669_2.png) [@echojoys](https://forum.elixirforum.com/u/echojoys)\
**Post date:** [October 31, 2022, 2:36am UTC](https://forum.elixirforum.com/t/return-string-form-rust-in-wasm/51372/6 "2022-10-31T02:36:56Z")

</div>

We know wasm is unable to return the string directly, of course we can use some libraries, but with elixir wasmex is unable to get directly, we usually pass in the address and length of the string through the memory function to get the string. Currently some languages already support [multi-value return](https://hacks.mozilla.org/2019/11/multi-value-all-the-wasm/), but rust is currently unable to do [multi-value](https://docs.rs/wasm-bindgen-multi-value-xform/latest/wasm_bindgen_multi_value_xform/index.html) return, so I used binary bit manipulation to solve this problem this is my [github](https://github.com/joeywang321/wasm_return_addr_len) repository, I hope to get everyone’s advice

---

_[View the full topic](https://forum.elixirforum.com/t/return-string-form-rust-in-wasm/51372)._
