【Rust日報】2019-11-11 - 關於Rust中的類型布局和ABI的注意事項

  • 2019 年 11 月 13 日
  • 筆記

關於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腳本的一部分執行並且不希望顯示完整而冗長的輸出就會特別有用。

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


From 日報小組 月泉

日報訂閱地址:

獨立日報訂閱地址:

  • Telgram Channel
  • 阿里雲語雀訂閱
  • Steemit
  • GitHub

社區學習交流平台訂閱:

  • Rust.cc 論壇: 支援 rss
  • Rust Force: 支援 rss
  • 微信公眾號:Rust 語言學習交流

Tags: