Skip to main content

ViewFn

Trait ViewFn 

Source
pub trait ViewFn<'a, State, Message, Theme, Renderer>
where Renderer: Renderer,
{ // Required method fn view( &self, state: &'a State, ) -> impl Widget<Message, Theme, Renderer> + 'a; }
Expand description

The view logic of some Application.

This trait allows the application builder to take any closure that returns any widget.

Required Methods§

Source

fn view(&self, state: &'a State) -> impl Widget<Message, Theme, Renderer> + 'a

Produces the widget of the Application.

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§

Source§

impl<'a, T, State, Message, Theme, Renderer, W> ViewFn<'a, State, Message, Theme, Renderer> for T
where T: Fn(&'a State) -> W, State: 'static, Message: 'static, Theme: 'static, Renderer: 'static + Renderer, W: Widget<Message, Theme, Renderer> + 'a,