Comprehensive Rust(繁体中文) 202406to 10. 305 • Now what if we want to return a value? • Look at docs again: – thread::spawn's closure returns T – JoinHandle .join() returns thread::Result• Use the Result return value from handle return values from threads! What about taking inputs? – Capture something by reference in the thread closure. – An error message indicates we must move it. – Move it in, see we can compute and then return a 0 码力 | 356 页 | 1.41 MB | 1 年前3
共 1 条
- 1
 













