-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
How to iterate Uint8Array
on Rust
#1160
Comments
Would Uint8Array::copy_to fit your use case? Maybe something along the lines of: let uint8array = Uint8Array::new();
let mut slice = vec![0; uint8array.length()];
uint8array.copy_to(&mut slice[..]) |
I am using The error I am getting:
Also @alexcrichton I don't know if you follow |
At this time, from what I can tell, This is actually totally allowed by SemVer since wasm-bindgen hasn't hit 1.0.0 yet.
You won't automatically get Quickest thing you can do is to go into your Cargo.toml and set Hope that works! |
We tried to update in I even tried to use |
Gotcha. The only other thing that comes to mind is that it's possible that Since the docs get built in CI on Can you set |
Thanks for the report @otaviopace and helping to narrow this doen @chinedufn! I've hopefully made it a bit easier to test this out and I've just gone ahead and published a new version of everything :) |
Thank you so much!!! It fixed the issue 🙂 |
Hello! I am trying to convert a
Uint8Array
to aVec<u8>
, however I am having problems to iterate it and get the values.Example code:
This code compiles, however it leads to this error on the browser:
Uncaught TypeError: getObject(...).forEach is not a function
.I've also tried using
try_iter
, but I couldn't convert theJsValue
to anu8
🙁This other example doesn't compile, and it leads to this error on
cargo
:The text was updated successfully, but these errors were encountered: