These are chat archives for rust-lang/rust
#[repr(C)]and primitive types
#[repr(C)]is completely unspecified
therefore, in order to pass a Vec to the C side you need to obtain a pointer to its data and its length, this can easily be done with Vec (actually slice) methods:
let data_ptr = vec.as_ptr(); let data_len = vec.len();
then you need to pass these values to the JS side and reconstruct its array from them
GenUint3<u8>, would be to box it, treat it as a
void*(or some other kind of "black box"), create a C API around that and otherwise only communicate types that are C and JS friendly.