parallel_worker 0.1.3

A parallel worker implementation in Rust. Allows to start tasks in parallel and receive the results blocking or non-blocking.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use std::cell::Cell;

pub trait CellUpdate<T> {
    fn modify<F: FnOnce(T) -> T>(&self, f: F);
}

impl<T: Copy> CellUpdate<T> for Cell<T> {
    fn modify<F: FnOnce(T) -> T>(&self, f: F) {
        let value = self.get();
        self.set(f(value));
    }
}