RenderOnce

Trait RenderOnce 

Source
pub trait RenderOnce: 'static {
    // Required method
    fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement;
}
Expand description

You can derive IntoElement on any type that implements this trait. It is used to construct reusable components out of plain data. Think of components as a recipe for a certain pattern of elements. RenderOnce allows you to invoke this pattern, without breaking the fluent builder pattern of the element APIs.

Required Methods§

Source

fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement

Render this component into an element tree. Note that this method takes ownership of self, as compared to Render::render() method which takes a mutable reference.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§