blob: 8b35eda95c56f0260b972ab8e2a548884416caf9 [file] [log] [blame] [view]
Allen George8b96bfb2016-11-02 08:01:08 -04001# Rust Thrift library
2
3## Overview
4
5This crate implements the components required to build a working Thrift server
6and 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
14The modules are layered as shown. The `generated` layer is code generated by the
15Thrift compiler's Rust plugin. It uses the components defined in this crate to
16serialize and deserialize types and implement RPC. Users interact with these
17types 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
33Add `thrift = "x.y.z"` to your `Cargo.toml`, where `x.y.z` is the version of the
34Thrift compiler you're using.
35
36## API Documentation
37
38Full [Rustdoc](https://docs.rs/thrift/)
39
40## Contributing
41
42Bug reports and PRs are always welcome! Please see the
43[Thrift website](https://thrift.apache.org/) for more details.
44
45Thrift 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
53All library code, test code and auto-generated code compiles and passes clippy
54without 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