Thrift
Cross-language RPC framework with a Rust crate for interoperable clients and servers.
Repository Health
Technical Analysis
Apache Thrift is a lightweight, language-independent stack for building point-to-point RPC clients and servers. The Rust crate implements the protocol, transport, and server layers that generated Thrift code builds on, letting Rust services talk to clients written in any of the 28 languages the Thrift compiler supports.
What You Get
- Binary and compact protocol implementations for serializing Thrift types
- Buffered, framed, and TLS-capable transport abstractions for TCP and other channels
- A threaded blocking server (
TServer) with pluggable processors for handling RPC calls - Rich, generated-code-friendly error types with Display impls for every Thrift exception
Common Use Cases
- Implementing a Rust server for a Thrift service also consumed by Java, Python, or Go clients
- Building a Rust client that calls into an existing polyglot Thrift RPC backend
- Adding TLS-secured Thrift transports between internal microservices
- Generating and running cross-language regression/compatibility tests via the Thrift compiler
Under The Hood
Architecture - The crate mirrors Thrift’s classic layered design: errors and autogen sit above protocol (binary/compact encoders), which sits above transport (buffered/framed/TLS channel wrappers), with server providing the request-dispatch loop (TServer) that generated service code plugs into as a processor. Application code never talks to protocol/transport directly in practice — it uses code emitted by the separate Thrift compiler (implemented in C++ elsewhere in the monorepo), which calls into this crate’s traits to (de)serialize types and drive RPC calls. Tech Stack - Rust 2021 edition, minimum Rust 1.65+ (1.71+ if the optional rustls feature is enabled). Core dependencies are minimal and focused: byteorder for wire-format integer encoding, integer-encoding for varints, uuid, ordered-float for comparable floats, with log and threadpool behind the default server feature, and rustls behind an opt-in rustls feature for TLS channels — the crate deliberately does not choose a crypto provider or load trust stores itself. Code Quality - Unit tests are colocated with implementation (configuration.rs, transport/buffered.rs, transport/mod.rs), plus dedicated integration tests (tests/shared_channel.rs, tests/tls.rs) and a test_recursive fixture crate; the wider Apache Thrift repo additionally runs cross-language test suites (make cross) that exercise the Rust implementation against every other supported language. Error handling is thorough — errors.rs defines typed exception variants generated code can match on, with a documented migration away from the deprecated Error::description() in favor of Display. API Design - The public surface is intentionally low-level and code-generation-oriented: hand-written application code is expected to interact with generated service traits rather than the protocol/transport primitives directly, which keeps ergonomics tied to how well the separate Thrift compiler’s Rust output reads rather than to this crate alone.
Used by 3 apps in this directory
Arroyo
Data Engineering · Analytics
A distributed stream processing engine written in Rust that lets you write SQL to run stateful, real-time computations over data streams with subsecond results.
InfluxDB
Databases · Analytics
Open-source time-series database built for real-time ingest, fast SQL queries, and embedded Python automation — powered by Apache Arrow and Parquet.
Quickwit
Search · Monitoring
Cloud-native search engine for logs and traces, delivering sub-second search directly on S3, GCS, or Azure Blob storage at a fraction of Elasticsearch's cost.