Uses old Rust 2015
|0.1.0||May 15, 2018|
Rust -> Swift IPC Data Schema Translator
Generates Swift data-types and serialization code for IPC(inter-process communication) to Rust.
You define data schema in Rust code, and execute this tool to
derive corresponding Swift-side data-types and serializations.
You can perform Rust-side serializaton with
and Swift-side serialization code
will be generated.
Intermediate messages will be coded in JSON.
How to Use
- Make a root level module named
- Define message data types in there.
- Execute this tool on Cargo workspace root.
An example is included in source tree.
Rust to/from Swift.
std::bool <-> Bool std::i64 <-> Int64 std::f64 <-> Float64 std::String <-> String std::option::Option <-> Optional std::vec::Vec <-> Array (enum) <-> (enum) (struct) <-> (struct)
Any other types will not be supported and code-generator will fail with an error.
- All fields must be
- Generated Swift-side serialization code supports only
serdebehavior. Any customizations won't work. So DO NOT customize
serdebehavior to make it work on Swift side.
- Only JSON container protocol is supported. Others maybe work if you can encode/decode them in Swift-side, but haven't been tested.
- No support for
Boxtype. So no recursive data type.
- No support for
HashMap(or any other associated collection) type.
- Performance. Make it work first.
- Other container protocol else than JSON.
- Nested modules. All types will be placed in flat namespace in Swift.
Constributions and License
Initial version has been written by Eonil. This project is licensed under "MIT License". Any contributions will become same license with this project.