ITPub博客

首页 > 数据库 > 数据库开发技术 > 【Rust日报】2021-09-11 Veloren发布v0.11

【Rust日报】2021-09-11 Veloren发布v0.11

原创 数据库开发技术 作者:Rust语言中文社区 时间:2021-09-11 23:57:21 0 删除 编辑

Tabled 发布v0.3

Tabled 是一个易于使用的库,用于美化 Rust 结构和枚举的输出。
Github链接,https://github.com/zhiburt/tabled

bma-benchmark 一个友好的基准测试工具

使用 bma_benchmark
#[macro_use]
extern crate bma_benchmark;

use std::sync::Mutex;

let n = 100_000_000;
let mutex = Mutex::new(0);
benchmark_start!();
for _ in 0..n {
let _a = mutex.lock().unwrap();
}
benchmark_print!(n);
使用宏 benchmark!
#[macro_use]
extern crate bma_benchmark;

use std::sync::Mutex;

let mutex = Mutex::new(0);
benchmark!(100_000_000, {
let _a = mutex.lock().unwrap();
});
Crate 链接,https://crates.io/crates/bma-benchmark

ferros

seL4 是一个用于构建操作系统和嵌入式程序的工具包,这个开源项目是使 Rust 中的 seL4 编程变得更好。
以下代码演练假定使用示例 sel4_start 库执行 selfe,并介绍了 ferros 的某些方面。
use selfe_sys;
use ferros::alloc::{self, micro_alloc, smart_alloc};
use ferros::userland::{root_cnode, BootInfo};

// The raw boot info is provided by the sel4_start library
let raw_boot_info: &'static selfe_sys::seL4_BootInfo = unsafe { &*sel4_start::BOOTINFO };


// Utility for finding and claiming `Untyped` instances supplied by the boot info.
let mut allocator = micro_alloc::Allocator::bootstrap(&raw_boot_info)?;
let initial_untyped = allocator
.get_untyped::<U20>() // The size of the Untyped instance, as bits
.expect("Couldn't find an untyped instance of the desired size");

// Create the top-level CNode wrapper with type-level-tracked remaining slot capacity
let (root_cnode, local_slots) = root_cnode(&raw_boot_info);

// Once we have an initial Untyped instance, memory distribution from it
// can be tracked with compile-time checks. The smart_alloc macro synthesizes
// the allocation code, and the capacity bounds are statically verified by
// the type checker. The effect is that you can write 'slots' in the macro body
// anywhere you need some slots, and you'll get the right number allocated
// with type inference. A reference to 'ut' does the same for untyped memory.
smart_alloc!(|slots from local_slots, ut from uts| {

// Create a page table seL4 kernel object and return a capability pointer to it.
// Here we use a variable binding type annotation and Rust's type system can figure out
// if it can allocate a large enough Untyped instance and enough cnode slots
// to represent this particular kernel object.
let example_page_table: LocalCap<UnmappedPageTable> = retype(ut, slots)?;

// Create a resource-tracking wrapper around the raw boot info to assist in
// virtual memory related operations.
let boot_info = BootInfo::wrap(raw_boot_info, ut, slots);
let (root_page_table, boot_info) = boot_info.map_page_table(root_page_table)?;
});

Github链接,https://github.com/auxoncorp/ferros

Veloren发布v0.11

今天,Veloren 发布了 0.11。这个版本已经制作了 3 个月,其一大重点是让世界各地的战斗更具活力。这是以新的地点系统的形式出现,以及 NPC 和生物如何与世界互动。
要了解还有哪些新功能!请继续阅读 V0.11 变更日志链接,https://veloren.net/release-0-11/
Rust 标准库中文版打包文件
【标准库】 Rust std html doc v1.55 中文版发布
有同学想看完整的标准库 doc 中文网页版, 看到了 https://github.com/wtklbm/rust-library-i18n 这个repo,很不错,但只能在vscode上看到中文提示。于是基于这个repo中的 dist/v1.55.zip ,做了一个std doc 中文网页版,可以通过浏览器看整个标准库 doc中文文档,可到 https://github.com/rcore-os/rust-library-i18n/releases/download/stable-1.55/cn-doc-v1.55.tar.xz 下载,压缩包20多兆,解压后500多兆。感谢 wtklbm !

From 日报小组 洋芋

社区学习交流平台订阅:
  • Rustcc论坛: 支持rss
  • 微信公众号:Rust语言中文社区

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

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

注册时间:2020-06-11

  • 博文量
    1769
  • 访问量
    718615