【Rust日报】 2019-08-01
paperclip - OpenAPI 规范的 Rust 实现
在完成后,它会实现:
- Rust 中的服务器端、客户端和命令行端的高效的、编译时检查的、类型安全的 HTTP API 的生成;
- 支持处理、验证和托管 OpenAPI 规范;
- 自定义规范和代码生成。
很有意思!
Repo: https://github.com/wafflespeanut/paperclip
Rust in Blockchain 七月总结
这个网页把在区块链领域中使用Rust的项目的最新进展做了一下汇总。感兴趣的可以看看。
https://rustinblockchain.org/2019/08/01/rust-in-blockchain-2-july-2019/
使用 Rust 实现类 Cairo 的库
Cairo 是一个 C 语言实现的 2D 图形渲染库,是大量平台的底层构件。那么是不是需要用 Rust 重新实现一个呢?
发现下面两个,可以直接到仓库中去查阅详细信息:
Jeff Hiner - 我们用 Rust 重写了我们的 IoT 平台,竟然成功了
这是一篇在 medium 上的文章,讲了作者一年前加入一个 IoT 公司后,逐渐引入了 Rust 来重写其 IoT 平台的经历和故事。包括手撸 mqtt 协议实现等。或许对犹豫是否在 IoT 中使用 Rust 带来一些借鉴意义。
这里https://docs.qq.com/doc/DQnFrd3pOVHd5ZktB是国内可访问版本。
这里https://medium.com/dwelo-r-d/we-rewrote-our-iot-platform-in-rust-and-got-away-with-it-2c8867c61b67是原文。
brpc-rs - X-lab 实验室新推出的一个rpc库
brpc-rs is part of the MesaLock Linux Project.
百度的 X-Lab 正在构建一个具有野心的体系 MesaLock Linux。brpc-rs 是对 Apache BRPC 的 Rust 绑定,是一个可用于工业级场景的 RPC 库。
Repo: https://github.com/mesalock-linux/brpc-rs
futures-async-stream - 实验性的流 API 语法
这个库方便基于现有的 async/await 语法使用一些标签来进行对于流的代码的处理,说起来比较拗口。直接上代码看,比如:
#![feature(async_await, stmt_expr_attributes, proc_macro_hygiene)]
use futures::prelude::*;
use futures_async_stream::for_await;
async fn collect(stream: impl Stream<Item = i32>) -> Vec<i32> {
let mut vec = Vec::new();
#[for_await]
for value in stream {
vec.push(value);
}
vec
}
#![feature(async_await, generators)]
use futures::prelude::*;
use futures_async_stream::async_stream;
// Returns a stream of i32
#[async_stream(item = i32)]
async fn foo(stream: impl Stream<Item = String>) {
// `for_await` is built into `async_stream`. If you use `for_await` only in `async_stream`, there is no need to import `for_await`.
#[for_await]
for x in stream {
yield x.parse().unwrap();
}
}
库在这里:https://github.com/taiki-e/futures-async-stream
关于使用 Rust 实现 Matrix 协议的 Ruma 项目的视频讲解
Matrix 协议是一个分布式IM通信协议,Ruma 是它的 Rust 实现。作者开课了,下面是第一个视频讲解(感叹一句,老外开发者做工作真心踏实,在教育上投入了很多心血)。
写给那些搞不懂代数效应的我们(翻译)
翻译题记:
昨天的Rust日报上刊登了一个实现了代数效应的Rust库,以及这篇文章的原版链接。
这是一篇通俗易懂的有趣文章,本文只是对其的粗略意译,并且省略了其中的链接(和表情包)。请有能力的朋友尽量前往原文围观。
地址在这里:https://zhuanlan.zhihu.com/p/76158581
From 日报小组 Mike
日报订阅地址:
独立日报订阅地址:
社区学习交流平台订阅:
Leave 【Rust日报】 2019-08-01 to:
Read more #rust posts
Best Posts From ChaosBot
We have not curated any of blackanger's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.