【Rust日报】2019-11-11 - 关于Rust中的类型布局和ABI的注意事项

关于Rust中的类型布局和ABI的注意事项

全文大纲如下:

1 The Anatomy of a Platform

2 The Anatomy of a Type

2.1 Size

2.2 Alignment

2.3 Offsets

2.4 Layout

2.5 ABI

2.6 The Layouts/ABIs of Builtins

2.7 Specifying Layouts and ABIs

3 Extended Random Notes

3.1 The C Integer Hierarchy

3.2 Endianness

3.3 Segmented Architectures

3.4 Calling Conventions

3.4.1 Problem and Motivation for Calling Conventions

3.4.2 Some Examples of Calling Conventions

感兴趣的读者可以浏览原文:https://gankra.github.io/blah/rust-layouts-and-abis/

rabbithole-rs - JSON API数据建模

Rabbithole-rs是一个类型化、用户友好的JSON:API类型的系统,具有易于使用的宏系统来帮助您对数据建模。

#[derive(rbh_derive::EntityDecorator, Serialize, Deserialize, Clone)]
#[entity(type = "dogs")]
pub struct Dog<'a> {
    #[entity(id)]
    pub id: String,
    pub name: String,
    #[entity(to_many)]
    pub fleas: Vec<Flea>,
    #[entity(to_many)]
    pub friends: Vec<Dog<'a>>,
    #[entity(to_one)]
    #[serde(bound(deserialize = "Box<Human<'a>>: Deserialize<'de>"))]
    pub master: Box<Human<'a>>,
    #[entity(to_one)]
    pub best_one: Option<Box<Dog<'a>>>,
}

Read more:https://github.com/UkonnRa/rabbithole-rs

ptail - 让进程的输出固定行数

ptail是一个小工具,它会截断进程的输出。 与tail -f不同,它在终端中显示的行数不会超过指定的数量。如果您正在将命令作为Shell脚本的一部分执行并且不希望显示完整而冗长的输出就会特别有用。 

640?wx_fmt=png

Read more:https://github.com/orf/ptail


From 日报小组 月泉

日报订阅地址:

独立日报订阅地址:

  • Telgram Channel

  • 阿里云语雀订阅

  • Steemit

  • GitHub

社区学习交流平台订阅:

  • Rust.cc 论坛: 支持 rss

  • Rust Force: 支持 rss

  • 微信公众号:Rust 语言学习交流

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值