← Quit0 / 0 correct
Why does this future fail to be Send, so tokio::spawn rejects it?
async fn handler(state: Arc<Mutex<Vec<u8>>>) {
let mut guard = state.lock().unwrap();
guard.push(1);
do_io().await;
guard.push(2);
}Why does this future fail to be Send, so tokio::spawn rejects it?
async fn handler(state: Arc<Mutex<Vec<u8>>>) {
let mut guard = state.lock().unwrap();
guard.push(1);
do_io().await;
guard.push(2);
}