Trait ui2::prelude::Element

source ·
pub trait Element: 'static + RenderOnce {
    type State: 'static;

    // Required methods
    fn layout(
        &mut self,
        state: Option<Self::State>,
        cx: &mut WindowContext<'_>
    ) -> (LayoutId, Self::State);
    fn paint(
        self,
        bounds: Bounds<Pixels>,
        state: &mut Self::State,
        cx: &mut WindowContext<'_>
    );

    // Provided method
    fn into_any(self) -> AnyElement { ... }
}

Required Associated Types§

source

type State: 'static

Required Methods§

source

fn layout( &mut self, state: Option<Self::State>, cx: &mut WindowContext<'_> ) -> (LayoutId, Self::State)

source

fn paint( self, bounds: Bounds<Pixels>, state: &mut Self::State, cx: &mut WindowContext<'_> )

Provided Methods§

Implementations on Foreign Types§

source§

impl Element for &'static str

§

type State = TextState

source§

fn layout( &mut self, _: Option<<&'static str as Element>::State>, cx: &mut WindowContext<'_> ) -> (LayoutId, <&'static str as Element>::State)

source§

fn paint( self, bounds: Bounds<Pixels>, state: &mut TextState, cx: &mut WindowContext<'_> )

Implementors§