| Allen George | 8b96bfb | 2016-11-02 08:01:08 -0400 | [diff] [blame] | 1 | # Rust Thrift library |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | This crate implements the components required to build a working Thrift server |
| 6 | and client. It is divided into the following modules: |
| 7 | |
| 8 | 1. errors |
| 9 | 2. protocol |
| 10 | 3. transport |
| 11 | 4. server |
| 12 | 5. autogen |
| 13 | |
| 14 | The modules are layered as shown. The `generated` layer is code generated by the |
| 15 | Thrift compiler's Rust plugin. It uses the components defined in this crate to |
| 16 | serialize and deserialize types and implement RPC. Users interact with these |
| 17 | types and services by writing their own code on top. |
| 18 | |
| 19 | ```text |
| 20 | +-----------+ |
| 21 | | app dev | |
| 22 | +-----------+ |
| 23 | | generated | <-> errors/results |
| 24 | +-----------+ |
| 25 | | protocol | |
| 26 | +-----------+ |
| 27 | | transport | |
| 28 | +-----------+ |
| 29 | ``` |
| 30 | |
| 31 | ## Using this crate |
| 32 | |
| 33 | Add `thrift = "x.y.z"` to your `Cargo.toml`, where `x.y.z` is the version of the |
| 34 | Thrift compiler you're using. |
| 35 | |
| 36 | ## API Documentation |
| 37 | |
| 38 | Full [Rustdoc](https://docs.rs/thrift/) |
| 39 | |
| 40 | ## Contributing |
| 41 | |
| 42 | Bug reports and PRs are always welcome! Please see the |
| 43 | [Thrift website](https://thrift.apache.org/) for more details. |
| 44 | |
| 45 | Thrift Rust support requires code in several directories: |
| 46 | |
| 47 | * `compiler/cpp/src/thrift/generate/t_rs_generator.cc`: binding code generator |
| 48 | * `lib/rs`: runtime library |
| 49 | * `lib/rs/test`: supplemental tests |
| 50 | * `tutorial/rs`: tutorial client and server |
| 51 | * `test/rs`: cross-language test client and server |
| 52 | |
| 53 | All library code, test code and auto-generated code compiles and passes clippy |
| 54 | without warnings. All new code must do the same! When making changes ensure that: |
| 55 | |
| 56 | * `rustc` does does output any warnings |
| 57 | * `clippy` with default settings does not output any warnings (includes auto-generated code) |
| 58 | * `cargo test` is successful |
| 59 | * `make precross` and `make check` are successful |
| 60 | * `tutorial/bin/tutorial_client` and `tutorial/bin/tutorial_server` communicate |