Trait pinned_init::ptr::OwnedUniquePtr
source · [−]pub unsafe trait OwnedUniquePtr<T: ?Sized>: DerefMut<Target = T> + Sized where
Self: TypesEq<Self::Ptr<T>>, {
type Ptr<U: ?Sized>: DerefMut<Target = U>;
unsafe fn transmute_pointee_pinned<U>(this: Pin<Self>) -> Pin<Self::Ptr<U>>
where
T: TransmuteInto<U>;
}Expand description
A (smart) unique pointer which owns its data (e.g. alloc::boxed::Box).
This pointer provides access to T via DerefMut.
Transmuting the pointee is also supported, if it implements
TransmuteInto<U> for some U.
Safety
All types implementing this trait need to
- own the data they point to.
- be the only way to access the data behind this pointer.
- provide the same pointer type as
Selfwith only a different pointee via theSelf::Ptrassociated type.
Required Associated Types
Required Methods
unsafe fn transmute_pointee_pinned<U>(this: Pin<Self>) -> Pin<Self::Ptr<U>> where
T: TransmuteInto<U>,
unsafe fn transmute_pointee_pinned<U>(this: Pin<Self>) -> Pin<Self::Ptr<U>> where
T: TransmuteInto<U>,
Transmute the type behind this pointer while being pinned.
Safety
This function does not
- move the pointee.
- mutate the pointee.
The caller needs to guarantee, that it is safe to transmute
TtoU(or equivalently, that it is safe to callTransmuteInto::transmute_ptr).