pub trait Component: Send + Sync {
// Required method
fn render(&self, state: &GA3) -> Element;
// Provided methods
fn initial_state(&self) -> GA3 { ... }
fn type_name(&self) -> &'static str { ... }
}Expand description
A component is a geometric morphism from state to renderable output.
Components transform geometric state into Element trees. The state is always a GA3 multivector, but components can interpret it in any way they choose (scalar counter, 3D position, etc.).
Required Methods§
Provided Methods§
Sourcefn initial_state(&self) -> GA3
fn initial_state(&self) -> GA3
Get the initial state for this component.
Returns the geometric state to use when the component mounts.