Skip to main content

IntoElement

Derive Macro IntoElement 

Source
#[derive(IntoElement)]
Expand description

重导出 rgpui_macros 中的过程宏(AppContext、IntoElement、Render 等) IntoElement 派生宏 - 用于将实现了 RenderOnce 特质的类型转换为 UI 组件。

该宏会为标记的类型生成 rgpui::IntoElement 特质的实现,使其可以作为 UI 元素在渲染树中使用。

§示例

ⓘ
#[derive(IntoElement)]
struct MyComponent {
    text: String,
}