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 Self with only a different pointee via the Self::Ptr associated type.

Required Associated Types

Access the same underlying pointer type with a different pointee type. Self == Self::Ptr<T>

Required Methods

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 T to U (or equivalently, that it is safe to call TransmuteInto::transmute_ptr).

Implementations on Foreign Types

Implementors