I need to hold an option for a runtime-chosen Box<Device>:
device: Option<Box<dyn Device<'a>>>
but the Device trait has associated types:
pub trait Device<'a> {
type RxToken: RxToken + 'a;
type TxToken: TxToken + 'a;
I'm getting
the value of the associated types
RxToken(from traitvirtual_tun::smoltcp::phy::Device),TxToken(from traitvirtual_tun::smoltcp::phy::Device) must be specified
Why do I need to specify these types if they're in a box? Whatever object that implements Device that I store in this Box is already gonna have its RxToken and TxToken chosen. I see no reason to have to specify it.
What can I do in this case?