Skip to main content

IntoElement

Trait IntoElement 

Source
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§

Source

fn into_element(self, cx: &'a FrameScope) -> Element<'a>

Provided Methods§

Source

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".

Implementors§

Source§

impl<'a, V: View> IntoElement<'a> for Handle<V>

Source§

impl<'a, W: Widget<'a>> IntoElement<'a> for W

Source§

impl<'a> IntoElement<'a> for DecodedImage

Source§

impl<'a> IntoElement<'a> for Div<'a>

Source§

impl<'a> IntoElement<'a> for Element<'a>

Source§

impl<'a> IntoElement<'a> for Img<'a>

Source§

impl<'a> IntoElement<'a> for InlineFlow<'a>

Source§

impl<'a> IntoElement<'a> for RichText<'a>

Source§

impl<'a> IntoElement<'a> for SceneCanvas<'a>

Source§

impl<'a> IntoElement<'a> for Text<'a>

Source§

impl<'a> IntoElement<'a> for VectorCanvas<'a>