pub unsafe trait VTableMetaDropInPlace: VTableMeta {
    unsafe fn drop_in_place(vtable: &Self::VTable, ptr: *mut u8) -> Layout;
    unsafe fn dealloc(vtable: &Self::VTable, ptr: *mut u8, layout: Layout);
}
Expand description

This trait is implemented by the #[vtable] macro.

It is implemented if the macro has a “drop_in_place” function.

Safety

The implementation of drop_in_place and dealloc must be correct

Required Methods

Safety

The target ptr argument needs to be pointing to a an instance of the VTable after the call to this function, the memory is still there but no longer contains a valid object.

Safety

The target ptr must have been allocated by the same allocator as the one which the vtable will delegate to.

Implementors