How to correct the code here? I did not get how traits and lifetimes get mixed. Would be very grateful if someone can explain why I'm getting this error and instruct on the correct way to fix it.
error[E0191]: the value of the associated type `TxBuffer` (from the trait `Device`) must be specified
--> src/main.rs:4:50
|
4 | iface : Interface<'static, 'static, 'static, Device + 'static>,
| ^^^^^^^^^^^^^^^^ missing associated type `TxBuffer` value
error[E0191]: the value of the associated type `RxBuffer` (from the trait `Device`) must be specified
--> src/main.rs:4:50
|
4 | iface : Interface<'static, 'static, 'static, Device + 'static>,
| ^^^^^^^^^^^^^^^^ missing associated type `RxBuffer` value
You need to initialize Foo properly - it expects a type parameter and you need to initialize the iface field which is where the type parameter is used.
You have to specify a real type for T at this point. It's like Vec<T> - when you want to actually use it with something concrete, you need to give a concrete type (e.g. Vec<i32>).