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§
type SubComponents
Required Methods§
Sourcefn sub_components(&self) -> &Self::SubComponents
fn sub_components(&self) -> &Self::SubComponents
Get the sub-components of this compound component
Sourcefn sub_components_mut(&mut self) -> &mut Self::SubComponents
fn sub_components_mut(&mut self) -> &mut Self::SubComponents
Get a mutable reference to sub-components
Sourcefn render_compound(&self) -> Result<Vec<Node>, ComponentError>
fn render_compound(&self) -> Result<Vec<Node>, ComponentError>
Render all sub-components in order