pub trait DynDynCastTarget: Sealed {
    type Root: ?Sized;

    // Required methods
    fn ptr_into_parts(
        ptr: NonNull<Self>
    ) -> (NonNull<()>, DynMetadata<Self::Root>);
    fn ptr_from_parts(
        data: NonNull<()>,
        meta: DynMetadata<Self::Root>
    ) -> NonNull<Self>;
    fn meta_for_ty<U: Unsize<Self>>() -> DynMetadata<Self::Root>;
}
Expand description

A type whose pointer metadata can be stored in a DynDynTable.

Required Associated Types§

source

type Root: ?Sized

The root type that the trait object metadata is for.

Required Methods§

source

fn ptr_into_parts(ptr: NonNull<Self>) -> (NonNull<()>, DynMetadata<Self::Root>)

Splits a fat pointer into its data pointer and metadata.

source

fn ptr_from_parts( data: NonNull<()>, meta: DynMetadata<Self::Root> ) -> NonNull<Self>

Combines a data pointer with the provided metadata to produce a fat pointer.

source

fn meta_for_ty<U: Unsize<Self>>() -> DynMetadata<Self::Root>

Gets the metadata that would be used for an object of concrete type U when cast to this type.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<M: ?Sized, T: Pointee<Metadata = DynMetadata<M>> + ?Sized> DynDynCastTarget for T

§

type Root = M