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 { ... }
}