3 ms·
Isn't this just `&dyn Trait`? Would it be a stack allocated, owning version of that, that can be moved? A pure `dyn Trait`?
by TheCoreh 3y ago
Isn't this just `&dyn Trait`?
Would it be a stack allocated, owning version of that, that can be moved? A pure `dyn Trait`?
- Ericson2314 3y agoNo. &mut dyn Foo is sugar for something like struct DynFoo<erase T> { vtable: &mut VTableFoo<T> ptr: &mut T } This is the underlying feature. `dyn` is a bit of an ad-hoc hack around not having this feature.