[][src]Trait abi_stable::pointer_trait::CanTransmuteElement

pub unsafe trait CanTransmuteElement<T>: GetPointerKind {
    type TransmutedPtr: Deref<Target = T>;
}

Whether the pointer can be transmuted to have T as the referent type.

Safety for implementor

Implementors of this trait must ensure that:

  • The memory layout of this type is the same regardless of the type of the referent .

  • The pointer type is either !Drop(no drop glue either), or it uses a vtable to Drop the referent and deallocate the memory correctly.

Associated Types

type TransmutedPtr: Deref<Target = T>[src]

The type of the pointer after it's element type has been changed.

Loading content...

Implementations on Foreign Types

impl<'a, T: 'a, O: 'a> CanTransmuteElement<O> for &'a T[src]

impl<'a, T: 'a, O: 'a> CanTransmuteElement<O> for &'a mut T[src]

Loading content...

Implementors

impl<'a, T, U> CanTransmuteElement<U> for RMut<'a, T> where
    U: 'a, 
[src]

type TransmutedPtr = RMut<'a, U>

impl<'a, T, U> CanTransmuteElement<U> for RRef<'a, T> where
    U: 'a, 
[src]

type TransmutedPtr = RRef<'a, U>

impl<T, O> CanTransmuteElement<O> for RArc<T>[src]

impl<T, O> CanTransmuteElement<O> for RBox<T>[src]

impl<T, O, Inline> CanTransmuteElement<O> for RSmallBox<T, Inline>[src]

type TransmutedPtr = RSmallBox<O, Inline>

impl<T, U> CanTransmuteElement<U> for StaticRef<T>[src]

Loading content...