Trait sauron_core::dom::Widget

source ·
pub trait Widget<MSG> {
    // Required methods
    fn update(&mut self, msg: MSG) -> Effects<MSG, ()>;
    fn view(&self) -> Node<MSG>;

    // Provided method
    fn style(&self) -> String { ... }
}
Expand description

A widget is a very simple component that can update itself view, but it can have no effect on the external component that use it.

Required Methods§

source

fn update(&mut self, msg: MSG) -> Effects<MSG, ()>

update the model of the widget

source

fn view(&self) -> Node<MSG>

how the widget display itself

Provided Methods§

source

fn style(&self) -> String

Widget can have a style

Implementors§