pub trait Task: Send + 'static {
// Required method
fn run(self);
}Expand description
A task that runs on a thread pool
A ThreadPool instance is pinned to run only a single type of task,
represented by implementations of Task. However, it is sometimes useful to
be able to schedule any arbitrary work to run on a thread pool. This can be
done by using Box<TaskBox> as the task type.