Dynamic dispatch selects a trait implementation at runtime. Rust trait objects (`dyn Trait`) use a compiler-generated vtable, letting one collection hold different types that implement the same trait. Because trait objects are unsized, store them through a pointer such as `Box`; `Vec<dyn Trait>` cannot hold them directly. Use dynamic dispatch deliberately: it can be an antipattern in some cases. section 2.2.6
let mut v = Vec::<Box<dyn MyTrait>>::new();
v.push(Box::new(MyStruct1 {})); #1
v.push(Box::new(MyStruct2 {})); #2
v.iter().for_each(|i| i.trait_hello()); #3
// v.iter().for_each(|i| i.struct_hello()); error! #4
The example stores two concrete types in `Vec<Box<dyn MyTrait>>` and calls their shared trait method. section 2.2.6

