Skip to main content

View

Trait View 

Source
pub trait View {
    // Required method
    fn build(&self, theme: &Theme) -> Element;
}
Expand description

A piece of UI, described declaratively as a function of theme.

Implementors return an Element tree. This is the static-composition entry point; interactive UIs use an app build closure threaded with a Cx (see the stipple umbrella crate’s App) to register handlers.

Required Methods§

Source

fn build(&self, theme: &Theme) -> Element

Build this view’s element tree under the given theme.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl View for Element

An Element is itself a (trivial) view.