(&self)
| 1244 | /// Every thread has at most one worker at a time. If a worker has already been |
| 1245 | /// set up, it may be accessed at any time by calling [`Worker::with_current`]. |
| 1246 | /// A thread's worker can also be manually set up by claiming a membership |
| 1247 | /// ([`ThreadPool::try_enroll`]) and passing it to [`Membership::activate`]. The |
| 1248 | /// worker returned by `with_current` always represents the membership most |
| 1249 | /// recently activated in the call stack. |
| 1250 | /// |
| 1251 | /// Every worker belongs to exactly one thread pool, and must hold a membership |
| 1252 | /// in one of the shared slots within that pool. |
| 1253 | /// |
| 1254 | /// Workers have one core memory-safety guarantee: Any jobs added to the worker |
| 1255 | /// will eventually be executed. |
| 1256 | pub struct Worker { |
| 1257 | /// Registers the worker as belonging to a specific thread pool, and |
| 1258 | /// potentially also grants "membership" on that thread-pool. |
| 1259 | pub(crate) membership: Membership, |
| 1260 | /// A sequence of jobs waiting to be executed. Newer jobs are executed |
no test coverage detected