Function vtable_for

const fn vtable_for<T, U: ptr::Pointee<Metadata = ptr::DynMetadata<U>> + ?Sized>() -> Option<ptr::DynMetadata<U>>

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.