ITPub博客

首页 > 数据库 > 数据库开发技术 > 【Rust日报】2023-04-28 Rust能防止死锁吗?

【Rust日报】2023-04-28 Rust能防止死锁吗?

原创 数据库开发技术 作者:Rust语言中文社区 时间:2023-04-28 23:56:35 0 删除 编辑

envy - 辅助集中处理环境变量

将你要用的环境变量一次性导入到类型安全的Rust结构体中,感觉非常好用。

use serde::Deserialize;

#[derive(Deserialize, Debug)]
struct Config {
foo: u16,
bar: bool,
baz: String,
boom: Option<u64>
}

fn main() {
match envy::from_env::<Config>() {
Ok(config) => println!("{:#?}", config),
Err(error) => panic!("{:#?}", error)
}
}

https://github.com/softprops/envy

Rust能防止死锁吗?

在默认情况下,不能。但是借助类型系统的辅助,我们只需要多付出一点努力,就可以在编译层面做到。来看看是怎么做的。

https://medium.com/@adetaylor/can-the-rust-type-system-prevent-deadlocks-9ae6e4123037

steveklabnik Rust book 作者正在研究如何用buck2来编译Rust项目

前段时间facebook开源了buck2构建系统,最近 steveklabnik 就在研究如何使用它来编译Rust.

https://steveklabnik.com/writing/using-cratesio-with-buck

Firebuild - 编译缓存能让大型Rust项目加速10倍编译

Firebuild 0.8 发布,加入对Rust的支持。号称能加速10倍Rust编译。

https://balintreczey.hu/blog/improve-build-time-of-rust-java-and-intel-fortran-projects-with-firebuilds-new-release/

Rust的异步是怎样工作的

这篇文章讲得比较清晰:

https://bertptrs.nl/2023/04/27/how-does-async-rust-work.html

--
From 日报小组 Mike

社区学习交流平台订阅:

  • Rust.cc 论坛:支持 rss

  • 微信公众号:Rust 语言中文社区


原文作者:Rust语言中文社区;如有侵权,请联系管理员删除。

请登录后发表评论 登录
全部评论

注册时间:2020-06-11

  • 博文量
    1769
  • 访问量
    718716