use constructivism::*; fn main() {} #[derive(Default, Construct)] #[construct(Color -> Nothing)] pub struct Color { /// Red channel r: f32, /// Green channel g: f32, /// Blue channel b: f32, /// Alpha channel #[prop(a, set_a)] a: f32, } impl Color { pub fn a(&self) -> f32 { self.a } pub fn set_a(&mut self, a: f32) { self.a = a } } #[derive(Construct)] #[construct(Div -> Nothing)] pub struct Div { /// The background color for the Div, transparent by default. #[prop(construct)] background: Color, } #[derive(Construct)] #[construct(Label -> Div)] pub struct Label { /// The text coklor, black by default. #[prop(construct)] text_color: Color, } impl Label {} // impl Model { // fn props(&self) { // let props = <::Props as Singleton>::instance(); // } // } fn _t() { let _p = <