pub unsafe trait Transfer {
// Required methods
unsafe fn transfer(src: &mut PinStack<'_, Self>, dst: *mut Self)
where Self: Sized;
fn empty() -> Tr<Self>;
}
Expand description
§Safety
- Implementers must write a valid
Self
to thedst
argument oftransfer
- Implementers are not allowed to panic in the
transfer
function - Implementers must reset
pin
to a value that can be safely dropped without incidence on thedst
pointer that was written to in thetransfer
function
Required Methods§
Sourceunsafe fn transfer(src: &mut PinStack<'_, Self>, dst: *mut Self)where
Self: Sized,
unsafe fn transfer(src: &mut PinStack<'_, Self>, dst: *mut Self)where
Self: Sized,
§Safety
- Callers of this function must call
reset
on thesrc
argument right afterwards. dst
must point to aSelf
instance, that can possibly be uninitializedsrc
anddest
must point to different instances.
fn empty() -> Tr<Self>
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.