Created
July 23, 2022 20:38
-
-
Save dherman/5aa20b55400c78966a1042e8f1f69fdf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* https://users.rust-lang.org/t/how-to-implement-index-range-usize-for-a-custom-slice-type-with-additional-data/66201 | |
* | |
* buffer.region(4, 16).into::<JsUint32Array> | |
* buffer.from(4).to(16).into::<JsUint32Array> | |
* buffer[4..16].to_typed_array::<u32, _>(&mut cx) | |
* JsUint32Array::from_region(&mut cx, buffer[4..16]) | |
* buffer.region(4..16).to_typed_array::<u32, _>(&mut cx) | |
* JsUint32Array::from_region(&mut cx, buffer.region(4..16)) | |
* JsUint32Array::from_buffer_region(&mut cx, buffer, 4, 16)) | |
* | |
* buffer.region::<u32>(4, 2).to_typed_array(&mut cx) | |
* JsUint32Array::from_region(&mut cx, buffer.region(4, 2)) | |
*/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment