Skip to main content

inflatable

Macro inflatable 

Source
macro_rules! inflatable {
    ($name:literal, $ctor:expr, children, { $($prop:literal => $setter:ident : $ty:ty),* $(,)? }) => { ... };
    ($name:literal, $ctor:expr, leaf, { $($prop:literal => $setter:ident : $ty:ty),* $(,)? }) => { ... };
}
Expand description

Register a widget with the interpreter WITHOUT hand-writing the build closure — the ergonomic front door to hot-reload extensibility.

You give the widget’s registry name, its zero-arg constructor, whether it takes children, and a "prop" => setter: Type table. Each entry maps a template prop to a builder method + the type to extract (via FromProp). This is the boilerplate the future #[derive(Widget)] would generate; it is also the single place a widget’s prop schema is declared (the same data a tooling/IDE schema would read).

inflatable!("Column", Column::new(), children, {
    "spacing" => spacing: f32,
});
inflatable!("Text", Text::new(""), leaf, {});   // leaf: no children