# 03_macros **Repository Path**: czlan91/03_macros ## Basic Information - **Project Name**: 03_macros - **Description**: rust 第三周 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-05-09 - **Last Updated**: 2024-05-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Geektime Rust 语言训练营 Rust 第三周 宏 # tag v3-5-attrs-with-darling v3-4-use-darling v3-3-enum-from-macro v3-2-macro-rules # commit chore: update cliff.toml chore: update change log chore: add class 3 docs feature: support parsing the attrs using darling feature: use darling to process EnumFrom macro feature: support generics for EnumFrom feature: support EnumFrom macro refactor: change crate to proc-macro feature: macro_rules examples chore: init the project for week 3 ## dev添加依赖, 给 examples 使用 ```shell cargo add anyhow cargo add futures cargo add tokio --features rt --features rt-multi-thread --features macros cargo add darling ``` # 添加依赖 ```shell cargo add proc-macro2 # 解析 topkenStream cargo add syn --features extra-traits # quotes 生成代码 cargo add quote ``` ## 运行的命令 ```shell cargo run --example my_vec cargo run --example my_try cargo run --example my_ready cargo run --example enum_macro cargo run --example enum_macro_darling cargo run --example enum_macro_darling_without_t cargo run --example auto_deref ``` ## 安装组件 ```shell cargo install cargo-expand ``` 查看 ```shell cargo expand --example enum_macro cargo expand --example enum_macro_darling cargo expand --example enum_macro_darling_without_t ```