Trait sauron::Component [−][src]
pub trait Component<MSG, XMSG> {
fn update(&mut self, msg: MSG) -> Effects<MSG, XMSG>;
fn view(
&self
) -> Node<&'static str, &'static str, &'static str, AttributeValue<MSG>>;
fn style(&self) -> String { ... }
fn get_component_id(&self) -> Option<&String> { ... }
}
Expand description
A component has a view and can update itself.
The update function returns an effect which can contain follow ups and effects. Follow ups are executed on the next update loop of this component, while the effects are executed on the parent component that mounts it.
Required methods
Update the model of this component and return follow up and/or effects that will be executed on the next update loop
Provided methods
fn get_component_id(&self) -> Option<&String>
fn get_component_id(&self) -> Option<&String>
Component can have component id to identify themselves