pub trait IntoElement<'a>: Sized {
// Required method
fn into_element(self, cx: &'a FrameScope) -> Element<'a>;
// Provided method
fn into_any_element(self, cx: &'a FrameScope) -> Element<'a> { ... }
}Expand description
将基础原语或无状态 Widget 统一转换为 Element<'a> 的转换 Trait。
Required Methods§
fn into_element(self, cx: &'a FrameScope) -> Element<'a>
Provided Methods§
Sourcefn into_any_element(self, cx: &'a FrameScope) -> Element<'a>
fn into_any_element(self, cx: &'a FrameScope) -> Element<'a>
与 GPUI .into_any_element() 对应的语义别名(零堆分配返回闭合枚举 Element<'a>)。
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".