A Rust write-up measures dyn Trait wide pointers and one vtable per type and trait pair
- Sources: primary, discussion
- Summary: The post inspects the in-memory layout behind
dyn Traitin Rust. Adyn Traitreference is a wide pointer holding the data pointer and a vtable pointer, and the compiler emits one vtable for each type and trait pair. - Why it matters: Rust picks dispatch at the call site rather than the class level, so a type carries no vtable pointer until a reference asks for dynamic dispatch, which is the opposite of the C++ arrangement.