1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
use tia::Tia; // 1. use #[derive(Tia)] // 2. derive #[tia(rg)] // 3. tia directives struct MyStruct { foo: i32, bar: String } fn main() { let mys = MyStruct { foo: 123, bar: "Hello".into() }; let foo = mys.get_foo(); // <-- 4. !! generated by tia automatically !! let bar = mys.get_bar(); // <-- 5. !! generated by tia automatically !! println!("foo={} bar={}", foo, bar); }