|
|
|
|
|
by dminik
110 days ago
|
|
It's not. The user has to decide. A specific type/reference to a type will always use static dispatch. fn foo(bar: &Baz) {
bar.thing();
} A dyn trait reference will always use dynamic dispatch and carry around the vtable pointer. fn foo(bar: &dyn BazTrait) {
bar.thing();
} |
|