Rust for C++

Threads

Transfer (channel)

Rust
let (tx, rx) = mpsc::channel::<Block>();

Run

Transfer trait (Send)

Rust
trait Message : Send {
    fn print(& self);
}

Run

Share (Arc)

Rust
let b = Arc::new(Mutex::new(Block{ value: 1 }));

Run