该贴的作者认为,在async趋于稳定之前,还有个重要的讨论,就是支持异步函数的返回类型的自定义命名。
async fn foo() -> impl Future<Output = usize> + Send { /**/ }
// or even to make the return type nameable
type FooReturn = impl Future<Output = usize> + Send;
async fn foo() -> FooReturn { /**/ }
Read more
一個替換舊版 await! 宏實作改成新版await 語法的工作
Read more
為每個庫增加權限控管。
有了這些權限,我們可以回答這些問題:
Read more
在嵌入式系統AMP systems上的一個 framework
可以寫各種原生的嵌入式程式
Read more
一個全局的分配器追踨器,可以追到wasm内存分配的情況
wasm-tracing-allocator
intel出品,代码不多,看上去确实简单,可以学习如何用rust实现一个kvm。
Read more
支持GZIP,ZLIB和DEFLATE压缩和解压缩
wasm-flate
/// Square a number if it's less than 10.
#[context]
fn square(num: usize) -> Result<usize, failure::Error> {
ensure!(num < 10, "Number was too large");
Ok(num * num)
}
输出
$ cargo run --example square 12
Error: ErrorMessage { msg: "Number was too large" }
Square a number if it's less than 10.
context-attribute