pub unsafe trait MoveNew: Sized {
// Required method
unsafe fn move_new(
src: Pin<MoveRef<'_, Self>>,
this: Pin<&mut MaybeUninit<Self>>,
);
}Expand description
A move constructible type: a destination-aware Clone that destroys the
moved-from value.
§Safety
After MoveNew::move_new() is called:
srcshould be treated as having been destroyed.thismust have been initialized.
Required Methods§
Sourceunsafe fn move_new(
src: Pin<MoveRef<'_, Self>>,
this: Pin<&mut MaybeUninit<Self>>,
)
unsafe fn move_new( src: Pin<MoveRef<'_, Self>>, this: Pin<&mut MaybeUninit<Self>>, )
Move-construct src into this, effectively re-pinning it at a new
location.
§Safety
The same safety requirements of New::new() apply, but, in addition,
*src must not be used after this function is called, because it has
effectively been destroyed.
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.