pub const fn vtable_for<T, U: Pointee<Metadata = DynMetadata<U>> + ?Sized>() -> Option<DynMetadata<U>>🔬This is a nightly-only experimental API. (
core_intrinsics)Expand description
The intrinsic returns the U vtable for T if T can be coerced to the trait object type U.
§Compile-time failures
Determining whether T can be coerced to the trait object type U requires trait resolution by the compiler.
In some cases, that resolution can exceed the recursion limit,
and compilation will fail instead of this function returning None.
§Safety
ptr must point to a vtable.