3 ms·
If you want to stay in safe Rust, sure. If that's too much overhead feel free to drop down to unsafe and do it just like in C/C++. FWIW Rc is pretty lightweigh
by vvanders 9y ago
If you want to stay in safe Rust, sure. If that's too much overhead feel free to drop down to unsafe and do it just like in C/C++.
FWIW Rc is pretty lightweight. Arc is the heavier(and threadsafe) variant.