pub unsafe trait CopyNew: Sized {
// Required method
unsafe fn copy_new(src: &Self, this: Pin<&mut MaybeUninit<Self>>);
}
Expand description
A copy constructible type: a destination-aware Clone
.
§Safety
After CopyNew::copy_new()
is called:
this
must have been initialized.
Required Methods§
Sourceunsafe fn copy_new(src: &Self, this: Pin<&mut MaybeUninit<Self>>)
unsafe fn copy_new(src: &Self, this: Pin<&mut MaybeUninit<Self>>)
Copy-construct src
into this
, effectively re-pinning it at a new
location.
§Safety
The same safety requirements of New::new()
apply.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.