benbrittain / rust-xdr

Generate Rust services from XDR RPC
https://tech.okcupid.com/rust-and-rpc-okcupid-hackweek-2017/
MIT License
29 stars 2 forks source link
codegen rust rust-services rust-xdr serialization xdr xdr-rpc

rust-xdr   Build Status

Converts XDR RPC definitions into Rust Services

Description

rust-xdr is a framework for building Rust services from XDR RPC specifications. This is 2 parts

Setup

Assuming a Rust/Cargo install

$ cargo install xdrgen
$ xdrgen --input <files that define your service or types> --output <directory>

If you are attempting to only use serde_xdr be aware that discrimant unions require extra serde annotations due to limitations of XDR. The examples directory shows how to properly annotate these if you are not codegening off a XDR file (which generates the annotations for you)

See the /examples directory.

Examples

Background

Built primarily during OkCupid Hack Week 2017, the goal of the project was to Proof Of Concept standing up Rust services that could easily interop with our existing C++ ones. Beyond building a typesafe (de)serialization library, we also wanted to automatically generate the the whole service, except for the implementation specific details for an RPC call.

Future Work

Contacts

Please file a github issue if you experience any problems

Specifications Implemented