Is it possible to have a custom copy/move function?

⚓ Rust    📅 2026-02-19    👤 surdeus    👁️ 10      

surdeus

Warning

This post was published 60 days ago. The information described in this article may have changed.

If I have something similar to an ArrayVec::arrayvec, as I understand it Rust copies all the bits when it is copied or moved. I was wondering if it is possible (or if it even makes sense) to have a custom copy/move function which only copies the initialised elements when moving or copying it.

[ I am not sure this is useful, it is just something I was thinking about, perhaps in a confused way ]

4 posts - 3 participants

Read full topic

🏷️ Rust_feed