force_copy

Crates.ioforce_copy
lib.rsforce_copy
version0.0.1
sourcesrc
created_at2021-07-29 00:14:00.76844
updated_at2021-07-29 00:14:00.76844
descriptionA wrapper to force-implement Copy for a type
homepage
repository
max_upload_size
id428506
size3,366
Aaron Hill (Aaron1011)

documentation

README

force_copy

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.

Limitations

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>>).

Commit count: 0

cargo fmt