3 ms·
"Trait objects" is lingo for `dyn Trait`. They are a distinct thing from just "trait". They allow virtual dispatch at runtime. See https://doc.rust-lang.org/re
by kaoD 2y ago
"Trait objects" is lingo for `dyn Trait`. They are a distinct thing from just "trait". They allow virtual dispatch at runtime.
See https://doc.rust-lang.org/reference/types/trait-object.html https://doc.rust-lang.org/reference/types/trait-object.html (`dyn Trait`, runtime dynamic dispatch) vs https://doc.rust-lang.org/reference/types/impl-trait.html https://doc.rust-lang.org/reference/types/impl-trait.html (`impl Trait`, compile-time monomorphization)