| Crates.io | dris-macros |
| lib.rs | dris-macros |
| version | 0.1.1 |
| created_at | 2026-01-16 06:41:07.159892+00 |
| updated_at | 2026-01-21 09:38:44.237286+00 |
| description | dris 的属性宏(#[component]/#[constructor]) |
| homepage | |
| repository | https://github.com/wuhaiji/dris |
| max_upload_size | |
| id | 2048017 |
| size | 3,178 |
dris-macros 提供 dris 的属性宏:
#[component]:标记一个组件类型(struct)。#[constructor]:标记组件的构造函数(pub fn,不允许 self 参数)。一般情况下你不需要直接依赖它:dris-rt 会重新导出这些宏,用户侧通常只需要依赖并 use dris_rt::{component, constructor};。
注意:这些宏本身不改代码,只是给 dris-build 扫描器“打点”;因此不要把组件/构造函数放在 cfg/cfg_attr 条件里,也不要依赖宏展开去生成组件声明(扫描器看不到)。