async-timer-Rust异步故事的计时器-Rust开发

时间:2021-05-27 19:51:03
【文件属性】:
文件名称:async-timer-Rust异步故事的计时器-Rust开发
文件大小:26KB
文件格式:ZIP
更新时间:2021-05-27 19:51:03
Rust WebAssembly 用于Rust的异步故事的最小计时器函数,最小Rust版本:1.36定时async fn job(){} async fn do_job(){let work = unsafe {{用于Rust的异步故事的最小计时器,最小Rust版本:1.36定时async fn job(){} async fn do_job(){让工作=不安全{async_timer :: Timed :: platform_new_unchecked(job(),core :: time :: Duration :: from_secs(1))}; match work.await {Ok(_)=> println!(“我完成了!”),//您可以通过轮询`expired` Err(expired)=> println!(“ Job expired:{}”, }}}间隔异步fn job(){}异步fn do_a_while(){l
【文件预览】:
async-timer-master
----.gitignore(35B)
----src()
--------utils.rs(781B)
--------interval.rs(2KB)
--------state.rs(8KB)
--------c_wrapper()
--------timed.rs(4KB)
--------timer()
--------lib.rs(2KB)
----LICENSE(1KB)
----Cargo.toml(2KB)
----.github()
--------workflows()
----README.md(2KB)
----tests()
--------timer.rs(859B)
--------interval.rs(2KB)
--------timed.rs(604B)
----build.rs(649B)

网友评论