Replies: 2 comments
-
Also fine if it's just not possible right now. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think it should be possible to use let str: String = args.get_or_undefined(0).try_js_into(ctx)?;
let arr = JsUint8Array::from_iter(str.bytes(), ctx)?;
let buffer = arr.get("buffer")?.as_object().cloned().unwrap();
let buffer = JsArrayBuffer::from_object(buffer)?;
let vec = buffer.take()?; It is suprising that we didn't offer a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I want to use
Uint8Array
. Converting a string toUint8Array
seems easy enough:But how can I do the opposite and get access to the underlying
Vec<u8>
:Thanks!
Beta Was this translation helpful? Give feedback.
All reactions