文件名称:coroutine-rs:Rust的协程库
文件大小:27KB
文件格式:ZIP
更新时间:2024-05-19 03:35:37
Rust
协程 Rust的协程库 [ dependencies ] coroutine = " 0.8 " 用法 协程的基本用法 extern crate coroutine; use std :: usize ; use coroutine :: asymmetric :: Coroutine; fn main () { let coro: Coroutine < i32> = Coroutine :: spawn ( | me,_ | { for num in 0 .. 10 { me. yield_with (num); } usize :: MAX }); for num in coro { println! ( "{}" , num. unwrap ()); } }
【文件预览】:
coroutine-rs-master
----LICENSE-MIT(1KB)
----Cargo.toml(694B)
----src()
--------asymmetric.rs(15KB)
--------lib.rs(2KB)
--------options.rs(433B)
--------coroutine()
----LICENSE-APACHE(11KB)
----examples()
--------refcount.rs(772B)
--------simple.rs(358B)
--------first_last.rs(254B)
----.travis.yml(270B)
----README.md(1KB)
----.gitignore(29B)