ronky/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use ronky_exported::Exported;
use ronky_proc::Export;
use serde_json::json;

#[allow(dead_code)]
#[derive(Export)]
struct Human {
    name: String,
    age: u32,
    friends: Vec<Human>,
    pets: Vec<Pet>,
}

#[allow(dead_code)]
#[derive(Export)]
struct Pet {
    name: String,
    species: String,
}

pub fn demo() {
    // todo!("make this properly exported and integrated with extensions")
    let human = Human::export();
    let pet = Pet::export();

    let types = json!({
        "types": [human, pet]
    });

    println!("{:#}", types);
}