Write Powerful Rust Macros

Van Overmeire, Sam

  • 出版商: Manning
  • 出版日期: 2024-06-18
  • 售價: $2,310
  • 貴賓價: 9.5$2,195
  • 語言: 英文
  • 頁數: 250
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1633437493
  • ISBN-13: 9781633437494
  • 相關分類: Rust 語言
  • 尚未上市,歡迎預購

相關主題

商品描述

Supercharge your code with macros--the real power tools of the Rust programming language!

Macros are instructions to generate new Rust code at compile-time, saving you hours of tedious code writing. The top Rust developers have built macros into everything from the standard library to crates. Now you can learn how these amazing "power tools" will help you push Rust to its full potential. This hands-on guide takes you from the absolute basics to advanced macro techniques.

Inside Write Powerful Rust Macros you'll discover:

  • Writing declarative macros
  • Procedural macros
  • Reading and debugging macro code
  • Improving the type system with newtypes and zero-sized types
  • How common Rust libraries use macros

Write Powerful Rust Macros teaches you how to write, test, debug, and publish macros for Rust. It's perfect for Rust practitioners who want to master this powerful development technique. In this unique book, you'll explore Rust macros through interesting and engaging examples, including automatically generating a 'builder' and composing a DSL for writing Infrastructure as Code.

Purchase of the print book includes a free eBook in PDF and ePub formats from Manning Publications.

About the book

Write Powerful Rust Macros is a comprehensive guide to creating macros in Rust. You'll start your journey with declarative macros, then quickly move on to the powerful procedural macros to build your own domain-specific language. Learn how to create public fields, work with custom attributes, integrate your macros with other crates, write effective tests to ensure your macros are reliable and bug-free, and even share your macros with other developers.

About the reader

For intermediate Rust programmers.

About the author

Sam Van Overmeire is a software developer with a background in history and archaeology. He is the author of multiple books, scientific articles and blog posts.

商品描述(中文翻譯)

使用宏來加速你的程式碼- Rust 程式語言的真正強大工具!

宏是在編譯時生成新的 Rust 程式碼的指令,可以節省你數小時的繁瑣程式碼撰寫時間。頂尖的 Rust 開發者已經將宏整合到從標準庫到 crates 的各個方面。現在,你可以學習這些令人驚奇的「強大工具」如何幫助你充分發揮 Rust 的潛力。這本實踐指南將帶你從基礎到高級的宏技巧。

在《寫出強大的 Rust 宏》中,你將會發現:

- 撰寫聲明式宏
- 過程式宏
- 讀取和調試宏程式碼
- 通過新類型和零大小類型改進類型系統
- 常見的 Rust 函式庫如何使用宏

《寫出強大的 Rust 宏》教你如何為 Rust 撰寫、測試、調試和發布宏。這本書非常適合想要掌握這種強大開發技術的 Rust 實踐者。在這本獨特的書中,你將通過有趣且引人入勝的例子來探索 Rust 宏,包括自動生成「建造者」和編寫基礎設施即代碼的 DSL。

購買印刷版書籍還包括 Manning Publications 提供的 PDF 和 ePub 格式的免費電子書。

關於本書

《寫出強大的 Rust 宏》是一本全面指南,教你如何在 Rust 中創建宏。你將從聲明式宏開始,然後迅速轉向強大的過程式宏,以構建自己的特定領域語言。學習如何創建公共字段,處理自定義屬性,將你的宏與其他 crates 整合,撰寫有效的測試以確保你的宏可靠無錯,甚至與其他開發者共享你的宏。

關於讀者

適合中級 Rust 程式設計師。

關於作者

Sam Van Overmeire 是一位具有歷史和考古學背景的軟體開發者。他是多本書籍、科學文章和部落格文章的作者。

作者簡介

Sam Van Overmeire is a software developer with a background in history and archaeology. He is the author of multiple books, scientific articles and blog posts.

作者簡介(中文翻譯)

Sam Van Overmeire 是一位具有歷史和考古學背景的軟體開發者。他是多本書籍、科學文章和部落格文章的作者。