Rust allows a true form of polymorphism through special forms of types implementing a trait. These are known as trait objects. Before we explain how Rust achieves polymorphism using trait objects, we need to understand the idea of dispatch.
Rust allows a true form of polymorphism through special forms of types implementing a trait. These are known as trait objects. Before we explain how Rust achieves polymorphism using trait objects, we need to understand the idea of dispatch.