0
点赞
收藏
分享

微信扫一扫

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

孟佳 2022-06-28 阅读 51

关于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脚本的一部分执行并且不希望显示完整而冗长的输出就会特别有用。 

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

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

日报订阅地址:

独立日报订阅地址:

  • Telgram Channel
  • 阿里云语雀订阅
  • Steemit
  • GitHub

社区学习交流平台订阅:

  • Rust.cc 论坛: 支持 rss
  • Rust Force: 支持 rss
  • 微信公众号:Rust 语言学习交流


举报

相关推荐

0 条评论