diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-06-27 22:28:48 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-06-27 23:25:48 +0100 |
| commit | 81168752fe9b588f7a8215f86a32f3154c3f593a (patch) | |
| tree | 7115bc38cd1e1e2f3cb91c6dc5b05bf854189d8e /examples | |
| parent | 6932fc110e1a6d734675a09fd6f5d889be1250b7 (diff) | |
Generate Rust types for structs
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/01-struct/hobgoblin.json5 | 4 | ||||
| -rw-r--r-- | examples/01-struct/output/rust/src/point.rs | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/examples/01-struct/hobgoblin.json5 b/examples/01-struct/hobgoblin.json5 index 472e586..b19ddfd 100644 --- a/examples/01-struct/hobgoblin.json5 +++ b/examples/01-struct/hobgoblin.json5 @@ -11,5 +11,9 @@ path: "output/java/src/gen/java", packageName: "org.zwobble.example.types", }, + { + generator: "rust-types", + path: "output/rust/src", + } ], } diff --git a/examples/01-struct/output/rust/src/point.rs b/examples/01-struct/output/rust/src/point.rs new file mode 100644 index 0000000..4a2b09c --- /dev/null +++ b/examples/01-struct/output/rust/src/point.rs @@ -0,0 +1,9 @@ +pub struct Line { + start: Point, + end: Point, +} + +pub struct Point { + x: i32, + y: i32, +} |
