We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Code snipper: I'm using the image and imageproc crates
image
imageproc
let buffer = image3.into_raw(); Ok(cx.buffer(buffer as usize)?)``` obviously doesn't work but i don't what to do
The text was updated successfully, but these errors were encountered:
https://docs.rs/neon/1.0.0-alpha.2/neon/types/buffer/trait.TypedArray.html#tymethod.from_slice
use neon::types::JsUint8Array; // Replace with the real data in a `Vec<u8>` let data: Vec<u8> = vec![1, 2, 3, 4]; JsUint8Array::from_slice(&data)
Note, as of writing this is only available in the 1.0 pre-release (1.0.0-alpha.2). In 0.10, there is a bit more boilerplate.
0.10
let mut buf = cx.array_buffer(data.len()); buf.as_mut_slice(&mut cx).copy_from_slice(&data); Ok(buf)
Sorry, something went wrong.
As linked above, that method is on the TypedArray trait which needs to be in scope to call it.
TypedArray
use neon::types::buffer::TypedArray;
I hope this helps. I'm going to close this issue since it's more of a support request than an issue with Neon. Cheers!
No branches or pull requests
Code snipper:
I'm using the
image
andimageproc
cratesThe text was updated successfully, but these errors were encountered: