DynTrait

Trait DynTrait 

Source
pub trait DynTrait {
    type Vtable: 'static;

    // Required methods
    fn drop_in_place_fn(vtable: &Self::Vtable) -> Option<unsafe fn(NonNull<()>)>;
    fn layout(vtable: &Self::Vtable) -> Layout;
}
Expand description

A trait object with its associated vtable.

Required Associated Types§

Source

type Vtable: 'static

The trait object vtable.

Required Methods§

Source

fn drop_in_place_fn(vtable: &Self::Vtable) -> Option<unsafe fn(NonNull<()>)>

Returns the drop function of the trait object as stored in vtable.

Source

fn layout(vtable: &Self::Vtable) -> Layout

Returns the layout of the trait object as stored in vtable.

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.

Implementations on Foreign Types§

Source§

impl DynTrait for dyn Any

Source§

type Vtable = __Vtable

Source§

fn drop_in_place_fn(vtable: &Self::Vtable) -> Option<unsafe fn(NonNull<()>)>

Source§

fn layout(vtable: &Self::Vtable) -> Layout

Source§

impl DynTrait for dyn Any + Send

Source§

type Vtable = __Vtable

Source§

fn drop_in_place_fn(vtable: &Self::Vtable) -> Option<unsafe fn(NonNull<()>)>

Source§

fn layout(vtable: &Self::Vtable) -> Layout

Source§

impl DynTrait for dyn Any + Send + Sync

Source§

type Vtable = __Vtable

Source§

fn drop_in_place_fn(vtable: &Self::Vtable) -> Option<unsafe fn(NonNull<()>)>

Source§

fn layout(vtable: &Self::Vtable) -> Layout

Source§

impl<'__lt, __TypeItem> DynTrait for dyn Iterator<Item = __TypeItem> + '__lt

Source§

type Vtable = __Vtable

Source§

fn drop_in_place_fn(vtable: &Self::Vtable) -> Option<unsafe fn(NonNull<()>)>

Source§

fn layout(vtable: &Self::Vtable) -> Layout

Source§

impl<'__lt, __TypeOutput> DynTrait for dyn Future<Output = __TypeOutput> + '__lt

Source§

type Vtable = __Vtable

Source§

fn drop_in_place_fn(vtable: &Self::Vtable) -> Option<unsafe fn(NonNull<()>)>

Source§

fn layout(vtable: &Self::Vtable) -> Layout

Source§

impl<'__lt, __TypeOutput> DynTrait for dyn Future<Output = __TypeOutput> + Send + '__lt

Source§

type Vtable = __Vtable

Source§

fn drop_in_place_fn(vtable: &Self::Vtable) -> Option<unsafe fn(NonNull<()>)>

Source§

fn layout(vtable: &Self::Vtable) -> Layout

Implementors§