Trait CompoundComponent

Source
pub trait CompoundComponent {
    type SubComponents;

    // Required methods
    fn sub_components(&self) -> &Self::SubComponents;
    fn sub_components_mut(&mut self) -> &mut Self::SubComponents;
    fn render_compound(&self) -> Result<Vec<Node>, ComponentError>;
}
Expand description

Compound component pattern - a component made of multiple sub-components

Required Associated Types§

Required Methods§

Source

fn sub_components(&self) -> &Self::SubComponents

Get the sub-components of this compound component

Source

fn sub_components_mut(&mut self) -> &mut Self::SubComponents

Get a mutable reference to sub-components

Source

fn render_compound(&self) -> Result<Vec<Node>, ComponentError>

Render all sub-components in order

Implementors§