Trait DynDynCastTarget

Source
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>;
}
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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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

Source§

type Root = M