赞
踩
const_unit_poc
就像一个具有更好的错误消息的 uom!
- #![feature(const_generics, const_evaluatable_checked)]
- use const_unit_poc::values::{m, kg, s, N};
-
- let distance = 1.0 * m;
- let mass = 18.0 * kg;
- let force = distance * mass / (1.8 * s * 2.0 * s);
- assert_eq!(force, 5.0 * N);
-
- let mut mutable_distance = 3.2 * m;
- mutable_distance -= 0.2 * m;
- mutable_distance += 2.0 * m;
-
- assert_eq!(mutable_distance, 5.0 * m);
-
const_unit_poc
crate 链接,https://docs.rs/const_unit_poc/1.0.0/const_unit_poc/
Knurling-rs,是用于开发和调试用于嵌入式系统的 Rust 软件。第七次的 changelog:
defmt-test
进入 crates.io,是no_std
测试工具,可以用于编写在微控制器上运行的单元测试。
发布了defmt
v0.1.1 和 probe-run
v0.1.5
Github链接,https://github.com/knurling-rs
Lunatic,用于构建使用 WebAssembly 实例作为 actors 的 Actor 系统平台。它在很大程度上受到 Erlang 的启发,可以从可编译为 WebAssembly 的任何语言中进行定位。当前只有 Rust 的绑定可用。
示例:
- use lunatic::{Channel, Process};
-
- fn main() {
- let channel = Channel::new(0);
- let vec: Vec<i32> = (0..1_000).collect();
-
- for i in vec.iter() {
- Process::spawn((*i, vec.clone(), channel.clone()), child).unwrap();
- }
-
- for _ in vec.iter() {
- let (i, sum) = channel.receive();
- println!("Sum until {}: {}", i, sum);
- }
- }
-
- // Child process calculates the sum of numbers of context.1 until context.0 index.
- fn child(context: (i32, Vec<i32>, Channel<(i32, i32)>)) {
- let i = context.0;
- let vec = context.1;
- let channel = context.2;
- let sum_until_i: i32 = vec[..=i as usize].iter().sum();
- channel.send((i, sum_until_i));
- }
-

该应用程序产生1000个子进程,并在每个子进程中计算从0到i的数字总和,然后将结果发送回父进程并进行打印。
Github链接,https://github.com/lunatic-lang/lunatic
使用 Rust GitHub 模板,可以立即创建一个托管在 GitHub 上的 Rust 项目。包括持续集成,持续部署和文档!
视频链接,https://www.youtube.com/watch?v=meAz2RQMHvM
介绍文章链接:https://rust-github.github.io/
From 日报小组 洋芋
社区学习交流平台订阅:
Rustcc论坛: 支持rss
微信公众号:Rust语言中文社区
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。