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:
src
should be treated as having been destroyed.this
must 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.