Skip to main contentCrate rust_implimentation
Source - InterfaceCat ๐
- A
Speaker implementation that meows. - InterfaceDog ๐
- A
Speaker implementation that barks. - PureBreedDog ๐
- The sole
SingleSpeaker implementation; there is nothing else to dispatch to.
- SingleSpeaker ๐
- Part 4: Monomorphic dispatch via a generic function.
- Speaker ๐
- Part 3: Interface-based polymorphism via trait objects (dynamic dispatch
through a vtable pointer embedded in the fat pointer
&dyn Speaker).
- direct_speak ๐
- Monomorphic target resolved at compile time via generics.
- main ๐
- make_speak ๐
- Dynamic Dispatch via trait object (
dyn Speaker).