[][src]Trait vtable::VTableMetaDropInPlace

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

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

pub unsafe fn drop_in_place(vtable: &Self::VTable, ptr: *mut u8) -> Layout[src]

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.

pub unsafe fn dealloc(vtable: &Self::VTable, ptr: *mut u8, layout: Layout)[src]

Safety

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

Loading content...

Implementors

Loading content...