pub unsafe trait Vtable<T>: DynTrait {
const DROP_IN_PLACE_FN: Option<unsafe fn(NonNull<()>)> = _;
// Required method
fn vtable<S: Storage>() -> &'static Self::Vtable;
}Expand description
A vtable constructor.
§Safety
DynTrait::layoutmust returncore::alloc::Layout::new::<T>().DynTrait::drop_in_place_fnmust returns<Self as crate::object::Vtable<T>>::DROP_IN_PLACE_FN
Provided Associated Constants§
Sourceconst DROP_IN_PLACE_FN: Option<unsafe fn(NonNull<()>)> = _
const DROP_IN_PLACE_FN: Option<unsafe fn(NonNull<()>)> = _
The function has the same safety contract that core::ptr::drop_in_place.
Required Methods§
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.