A Practical Introduction to Declarative Macros in Rust
Автор: Schrödinger's Watermelon
Загружено: 2023-04-21
Просмотров: 6159
Описание:
In this video, we'll give you a practical introduction to declarative macros in Rust. We'll start with a simple example to help you understand what declarative macros are and how they can be written. We'll then explore positional, infinite positional, and named parameters in declarative macros, as well as fragment specifiers of parameters. By the end of this video, you'll have a solid understanding of declarative macros in Rust and how you can use them to make your code more concise and maintainable.
To learn more about macros in Rust, check out the Macros section in the Rust Book at https://doc.rust-lang.org/book/ch19-0.... For more information on declarative macros specifically, you can also refer to the Declarative Macros reference at https://doc.rust-lang.org/reference/m....
The background music for this video includes "Jazzy Hip Hop Boom Bap" and "Sweet Chillhop" by Music Unlimited, "Lofi Vintage" and "Street Food" by FASSounds.
Don't forget to follow me on my social media accounts:
Blog: https://erayerdin.com/
GitHub: https://github.com/erayerdin
Twitter: / _erayerdin
Stack Overflow: https://stackoverflow.com/users/29269...
Telegram: https://t.me/erayerdin
Hashtags: #macros #declarative #rust #rustlang #metaprogramming
00:00 Introduction
00:06 What is a macro?
00:56 Warnings
01:38 Example project
01:58 Creating the project
02:07 A simple macro with positional parameters
02:42 Parameter types for declarative macros
03:26 Desugaring the macros with rust-analyzer
03:49 Another simple macro
04:07 Named parameters in declarative macros
05:06 Infinite positional parameters in declarative macros
06:33 Using macros outside a crate
06:47 Exporting macros to be used outside the crate
06:45 Using macros outside a crate (again)
07:15 Ending
Повторяем попытку...

Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: