pub type RunnableJoinHandle = Box<dyn RunnableJoinHandleTrait>;
pub trait RunnableJoinHandleTrait {
fn join(self) -> Result<(), ()>;
}
impl RunnableJoinHandleTrait for std::thread::JoinHandle<()> {
fn join(self) -> Result<(), ()> {
<Self as std::thread::JoinHandle<()>>::join(self)
}
}
Error:
error[E0576]: cannot find method or associated constant `join` in `std::thread::JoinHandle`
--> src/lib.rs:7:48
|
7 | <Self as std::thread::JoinHandle<()>>::join(self)
| ^^^^ not found in `std::thread::JoinHandle`
but clearly the method exists JoinHandle in std::thread - Rust