Rust -> Swift IPC Data Schema Translator

Eonil

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 serde. and Swift-side serialization code will be generated.

Intermediate messages will be coded in JSON.

How to Use

  1. Make a root level module named to_swift.
  2. Define message data types in there.
  3. Execute this tool on Cargo workspace root.

An example is included in source tree.

Type Mappings

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.

Goal

Limitations

Non-Goal

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.