嵌入式开发中的 async/await
这篇博客中讨论了为什么"async/await"对于嵌入式开发来说是比较重要的一个功能. 文章从一下几个角度来分析:
- 从阻塞到非阻塞
 - 多任务处理
 - 线程
 - 数据共享
 - ...
 
详情:https://ferrous-systems.com/blog/async-on-embedded/
几个小技巧让你的 Rust 代码性能
不用改动代码,只通过几个技巧就能提高你的 Rust 项目运行速度,比如在 `Cargo.tom` 文件中 [profile.release] 下根据情况更改一些字段或许就可以提升你的项目性能:
- 
lto = "fat" - 
codegen-units = 1 - 
target-cpu = "native" - ...
 
详细介绍:https://deterministic.space/high-performance-rust.html
Firecracker: serverless 应用的轻量级虚拟化
详情: https://blog.acolyer.org/2020/03/02/firecracker/
Rust blog:近期以及未来的模式匹配改进
Rust 官方博客介绍了即将了即将应用于stable Rust 的模式匹配新特性
Subslice 模式匹配,[head, tail @ ..]
.. 意味着可变间隔,例如
fn recover_attrs_no_item(&mut self, attrs: &[Attribute]) -> PResult<'a, ()> {
let (start, end) = match attrs {
        [] => return Ok(()),
        [x0] => (x0, x0),
        [x0, .., xn] => (x0, xn),
    };
let msg = if end.is_doc_comment() {
"expected item after doc comment"
    } else {
"expected item after attributes"
    };
let mut err = self.struct_span_err(end.span, msg);
if end.is_doc_comment() {
        err.span_label(end.span, "this doc comment doesn't document anything");
    }
if let [.., penultimate, _] = attrs {
        err.span_label(start.span.to(penultimate.span), "other attributes here");
    }
Err(err)
}其中 [x0, .., xn] 就表示匹配第一个以及最后一个元素而忽略中间的所有元素.
另一种用法是可以将subslice约束为一个变量,比如如果我们希望某个函数除了最后一个参数之外的参数不能为 ... 那么可以这样写:
match &*fn_decl.inputs {
    ... // other arms
    [ps @ .., _] => {
for Param { ty, span, .. } in ps {
if let TyKind::CVarArgs = ty.kind {
self.err_handler().span_err(
                    *span,
"`...` must be the last argument of a C-variadic function",
                );
            }
        }
    }
}这里的 ps @ .. 就表示忽略参数的最后的一个元素而将剩下的元素转化为 变量 ps
其他还有
- Nested OR-patterns
 - Bindings after @
 - Combining by-move and by-ref bindings
 
详情: https://blog.rust-lang.org/inside-rust/2020/03/04/recent-future-pattern-matching-improvements.html









