pub struct ThreadPool; // ANCHOR: here impl ThreadPool { /// 创建一个新的线程池。 /// /// size 是池中线程的数量。 /// /// # Panics /// /// 如果 size 为 0,`new` 方法会 panic。 pub fn new(size: usize) -> ThreadPool { assert!(size > 0); ThreadPool } // --snip-- // ANCHOR_END: here pub fn execute(&self, f: F) where F: FnOnce() + Send + 'static, { } // ANCHOR: here } // ANCHOR_END: here