I find I am using this pattern a lot.
Arc<Mutex<dyn SomeTrait + Send>>;
and so I thought I would do this:
pub type NicePtr<T> = Arc<Mutex<dyn T + Send>>;
but this does not compile
Compiling rsim v0.1.0 (C:\work\pdp\rsim)
error[E0404]: expected trait, found type parameter `T`
--> src\common.rs:9:37
|
9 | pub type NicePtr<T> = Arc<Mutex<dyn T + Send>>;
| ^ not a trait
I assume this is possible, but I just dont know the correct syntax.