前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【Rust日报】2019-11-11 - 关于Rust中的类型布局和ABI的注意事项

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

作者头像
MikeLoveRust
发布2019-11-13 11:04:17
5990
发布2019-11-13 11:04:17
举报

关于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类型的系统,具有易于使用的宏系统来帮助您对数据建模。

代码语言:javascript
复制
#[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脚本的一部分执行并且不希望显示完整而冗长的输出就会特别有用。

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


From 日报小组 月泉

日报订阅地址:

独立日报订阅地址:

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

社区学习交流平台订阅:

  • Rust.cc 论坛: 支持 rss
  • Rust Force: 支持 rss
  • 微信公众号:Rust 语言学习交流
本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2019-11-11,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 Rust语言学习交流 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 关于Rust中的类型布局和ABI的注意事项
  • rabbithole-rs - JSON API数据建模
  • ptail - 让进程的输出固定行数
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档