Crates.io | force_copy |
lib.rs | force_copy |
version | 0.0.1 |
source | src |
created_at | 2021-07-29 00:14:00.76844 |
updated_at | 2021-07-29 00:14:00.76844 |
description | A wrapper to force-implement Copy for a type |
homepage | |
repository | |
max_upload_size | |
id | 428506 |
size | 3,366 |
NOTE: This is still WIP.
A Rust crate that allows making a non-Copy
type into a Copy
type.
Simply wrap your type in ForceCopy
(e.g. ForceCopy<MyType>
) - the resulting type implements Copy
, and can be used in a #[derive(Copy]
struct.
The wrapped type must not have a destructor - this is a language-level limitation which cannot be circumvented.
To ignore the destructor of a type, wrap it in ManuallyDrop
(e.g. ForceCopy<ManuallyDrop<String>>
).