rust trait bounds vs trait objects
- trait bounds
- this is generic programming (see parametric polymorphism)
- a different version of the function is compiled per concrete type that this function will be called with
- trait objects
- this is dynamic dispatch
- at runtime, an object is called that can dispatch the correct version of the method (see polymorphism)