wasm-bindgen
wasm-bindgen copied to clipboard
how to support Vec<f32>
Describe the Bug
the trait bound Vec<f32>: RefFromWasmAbi is not satisfied
the trait RefFromWasmAbi is not implemented for Vec<f32>rustcE0277
the trait bound Vec<f32>: RefMutFromWasmAbi is not satisfied
the trait RefMutFromWasmAbi is not implemented for
A clear and concise description of what the bug is.
Steps to Reproduce
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
If applicable, add a link to a test case (as a zip file or link to a repository we can clone).
Expected Behavior
A clear and concise description of what you expected to happen.
Actual Behavior
A clear and concise description of what actually happened.
If applicable, add screenshots to help explain your problem.
Additional Context
Add any other context about the problem here.
Is there a reason you can't use f64 and later convert it to f32 (if really needed)
With a vector of million of points, you probably don't want to use twice the memory.
Both &[f32] and Vec<f32> can be used as arguments, but not &Vec<f32>, which is what you seem to be trying to do. Using &[f32] or Vec<f32> instead should work.
Thx for the hint.
I think i am using a *f32 + unsafe block now, ill make a second try with a Vec then.