let tx = tx.lock().unwrap();
if tx.await.is_err() {
println!("send err");
return Ok(());
}
I have some codes like this, it reports the trait Future is not implemented for `std::sync::MutexGuard<'_, FutureTx>, while FutureTx has been implemented Future.
The reason for the particular error you got is that .await requires taking ownership of the value, but you don't have ownership — only a mutable borrow.
However even if you fix this, you will probably run into the error described here. A blocking mutex may not be locked during a use of .await.