|
json-gen-c
0.1.5
json-gen-c generate C code for json manipulation
|
Generate a Rust module (.rs) with native serde-compatible structs and enums from the parsed schema. The output is a single self-contained Rust file that uses serde + serde_json for JSON serialization. More...
#include "gencode/gencode.h"#include "struct/struct_parse.h"#include "utils/hash_map.h"#include "utils/sstr.h"#include <stdio.h>#include <string.h>#include <ctype.h>
Classes | |
| struct | enum_emit_ctx |
| struct | rust_gen_ctx |
| struct | dep_emit_struct_ctx |
Functions | |
| int | gencode_rust (struct hash_map *struct_map, struct hash_map *enum_map, struct hash_map *oneof_map, sstr_t output) |
| generate a Rust module (.rs) with native serde-compatible structs and enums. | |
Generate a Rust module (.rs) with native serde-compatible structs and enums from the parsed schema. The output is a single self-contained Rust file that uses serde + serde_json for JSON serialization.
| int gencode_rust | ( | struct hash_map * | struct_map, |
| struct hash_map * | enum_map, | ||
| struct hash_map * | oneof_map, | ||
| sstr_t | output | ||
| ) |
generate a Rust module (.rs) with native serde-compatible structs and enums.
| struct_map | parsed struct definitions. |
| enum_map | parsed enum definitions. |
| oneof_map | parsed oneof (tagged union) definitions. |
| output | the output Rust source content. |