Type Alias TryIntoInnerFn

Source
pub type TryIntoInnerFn = for<'src, 'dst> unsafe fn(src_ptr: PtrMut<'src>, dst: PtrUninit<'dst>) -> Result<PtrMut<'dst>, TryIntoInnerError>;
Expand description

Function to convert a transparent/newtype wrapper into its inner type.

This is used for types that wrap another type (like smart pointers, newtypes, etc.) where the wrapper can be unwrapped to access the inner value. Primarily used during serialization.

ยงSafety

This function is unsafe because it operates on raw pointers.

The src_ptr must point to a valid, initialized instance of the wrapper type. The dst pointer must point to valid, uninitialized memory suitable for holding an instance of the inner type.

The function will return a pointer to the initialized inner value.