10 Minutes - Understand Derive Procedural Macro in Rust Language

Опубликовано: 03 Апрель 2026
на канале: Daily dose of Rust Language
669
17

One-stop video to understand the Derive Procedural Macro in the Rust programming language.

In this video, we will explore an example of how and when to use the derive procedural macro in Rust.

== Related Videos ==
Part 1 - Macros In Rust    • Rust macro Is So Easy to Understand  

Part 2 - Decorative Macros - Auto generate functions with Macros    • Rust macro Is So Easy to Understand  

Part 3 - Declarative Macro Create a macro that will automatically generate Structs, the Struct's fields, getters, setters, and a constructor associated function called "new()"    • Rust Generate Unlimited Structs with Macro...  

== Connect with us ==
Website: https://daily-dose-of-rust-language.p...
Youtube Subscribe: https://bit.ly/ytddrust
Facebook: https://bit.ly/fbddrust
Twitter: https://bit.ly/twddrust
Linkedin: https://bit.ly/linkedinddrust

== Table of Content ==
0:00 Intro
0:45 3 Types of Macros in Rustlang
0:56 The task for this Video
1:49 Example - create Custom Derive macro in Rust
3:29 Step 1 - How to create a Procedural Macro Crate
4:40 Step 2 - Add the dependencies - syn and quote crates
05:02 Step 3 - Create the custom derive macro
06:14 What is AST (Abstract Syntax Tree) in rust?
7:10 3 kinds of Errors that can occur while compiling a custom derive macro
8:42 Step 4 - Import the Derive macro and use it
09:09 Step 5 - Let's use the custom derive macro we just created
9:35 - Summary
09:58 - Intro to Next Video - Subscribe for more