Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to return a Vec<String> #168

Closed
mstange opened this issue Apr 25, 2018 · 1 comment · Fixed by #3554
Closed

Ability to return a Vec<String> #168

mstange opened this issue Apr 25, 2018 · 1 comment · Fixed by #3554
Labels
more-types Adding support for more Rust types to cross the boundary

Comments

@mstange
Copy link
Contributor

mstange commented Apr 25, 2018

Annotating a function which returns a Vec<String> with #[wasm_bindgen] gives the following error:

error[E0277]: the trait bound `std::boxed::Box<[std::string::String]>: wasm_bindgen::convert::IntoWasmAbi` is not satisfied
  --> src/lib.rs:12:1
   |
12 | #[wasm_bindgen]
   | ^^^^^^^^^^^^^^^ the trait `wasm_bindgen::convert::IntoWasmAbi` is not implemented for `std::boxed::Box<[std::string::String]>`
   |
   = help: the following implementations were found:
             <std::boxed::Box<[f64]> as wasm_bindgen::convert::IntoWasmAbi>
             <std::boxed::Box<[u32]> as wasm_bindgen::convert::IntoWasmAbi>
             <std::boxed::Box<[i16]> as wasm_bindgen::convert::IntoWasmAbi>
             <std::boxed::Box<[u16]> as wasm_bindgen::convert::IntoWasmAbi>
           and 5 others
   = note: required because of the requirements on the impl of `wasm_bindgen::convert::IntoWasmAbi` for `std::vec::Vec<std::string::String>`

@alexcrichton alexcrichton added the more-types Adding support for more Rust types to cross the boundary label Apr 26, 2018
@alexcrichton
Copy link
Contributor

Similar to #111 in how this'll probably be solved (not entirely sure yet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-types Adding support for more Rust types to cross the boundary
Projects
None yet
2 participants