I see. But then what prevents you from wrapping the buffer pointer into a struct, which only has setters that
memcpy at a particular index? If this setter would just
memcpy with the right offset, it should get completely inlined and you should have the same code as if it was in C, no? The only thing needed from the generics would be how the object gets copied, which should probably be handled by
memcpy as well, since both
[u16] is and
[Vertex] are contiguous blocks.
I might be missing some limitation of Rust though, I’m fairly new to it (coming from C++).