1 2 3 4 5 6 7 8 9 10 11 12
use std::thread::{Thread, JoinGuard}; pub trait Executor { type Guard; fn submit(&self, job: F) where F: FnOnce() -> Self::Guard; } pub struct NativeThreadPerJob; impl Executor for NativeThreadPerJob { type Guard = JoinGuard }