3 ms·
> The equivalent of a generic memcpy is probably something like a .clone() call on a generic type that implements Clone. If you type "memcpy" into the document
by steveklabnik 4y ago
> The equivalent of a generic memcpy is probably something like a .clone() call on a generic type that implements Clone.
If you type "memcpy" into the documentation search, rustdoc will point you to
* https://doc.rust-lang.org/stable/std/primitive.slice.html#method.copy_from_slice https://doc.rust-lang.org/stable/std/primitive.slice.html#me...
* https://doc.rust-lang.org/stable/std/intrinsics/fn.copy_nonoverlapping.html https://doc.rust-lang.org/stable/std/intrinsics/fn.copy_nono... (Though it should really point to the reexport at https://doc.rust-lang.org/stable/std/ptr/fn.copy_nonoverlapping.html https://doc.rust-lang.org/stable/std/ptr/fn.copy_nonoverlapp... )
The latter will also mention
* https://doc.rust-lang.org/stable/std/ptr/fn.copy.html https://doc.rust-lang.org/stable/std/ptr/fn.copy.html