Trait owned_pin::RawConvertable
source · pub unsafe trait RawConvertable: Deref {
type Metadata: Sized;
// Required methods
fn into_raw(this: Self) -> (NonNull<Self::Target>, Self::Metadata);
unsafe fn from_raw(
pointer: NonNull<Self::Target>,
metadata: Self::Metadata
) -> Self;
}Expand description
Smart pointers that can convert themselves into raw forms, and is able to convert raw forms back to themselves.
Safety
The implementor of this trait must enable any valid raw form to be converted back to its corresponding valid smart pointer.
Required Associated Types§
Required Methods§
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<T, A: Allocator + Clone> RawConvertable for Rc<T, A>
impl<T, A: Allocator + Clone> RawConvertable for Rc<T, A>
source§fn into_raw(this: Self) -> (NonNull<T>, A)
fn into_raw(this: Self) -> (NonNull<T>, A)
See Rc::into_raw and Rc::allocator for more information.
source§unsafe fn from_raw(pointer: NonNull<T>, metadata: A) -> Self
unsafe fn from_raw(pointer: NonNull<T>, metadata: A) -> Self
See Rc::from_raw_in for more information.
type Metadata = A
source§impl<T, A: Allocator + Clone> RawConvertable for Arc<T, A>
impl<T, A: Allocator + Clone> RawConvertable for Arc<T, A>
source§fn into_raw(this: Self) -> (NonNull<T>, A)
fn into_raw(this: Self) -> (NonNull<T>, A)
See Rc::into_raw and Rc::allocator for more information.
source§unsafe fn from_raw(pointer: NonNull<T>, metadata: A) -> Self
unsafe fn from_raw(pointer: NonNull<T>, metadata: A) -> Self
See Rc::from_raw_in for more information.