cogo 0.1.36

Rust Coroutine Library like go
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use cogo::{defer, spawn_blocking};

fn main(){
    let v = spawn_blocking!(|| {
        return 1;
    });
    match v{
        Ok(v) => {
            println!("{}",v);
        }
        Err(e) => {
            println!("{}",e);
        }
    }
}