Skip to content

Glossary: Software Design Patterns in Rust

Dynamic dispatch

Also written: dyn Trait, dyn

Calling a method through `dyn Trait`, where the exact method is looked up while the program runs. This lets different types share a Vec, at the cost of a pointer and an indirect call.

Where the book teaches it

Related terms

Static dispatchTrait objectGeneric