explaingit

google/tarpc

Analysis updated 2026-07-03

3,696RustAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

Rust library for calling functions in remote services over the network using plain Rust traits, with no code generation step or separate description language required.

Mindmap

mindmap
  root((repo))
    What it does
      Remote procedure calls
      No code generation
      Request deadlines
    Tech stack
      Rust
      Tokio async
      Pluggable transport
    Use cases
      Microservice comms
      Cancellation propagation
      Distributed tracing
    Audience
      Rust developers
      Backend engineers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a Rust microservice that other services can call over the network by defining a single Rust trait, with no extra tools or generated code.

USE CASE 2

Add automatic request timeouts and cancellation propagation across a chain of Rust services without writing that logic yourself.

USE CASE 3

Test service code using in-memory channels, then switch to a real TCP transport for deployment with minimal code changes.

USE CASE 4

Track how a single request flows through multiple backend services using tarpc's built-in distributed tracing support.

What is it built with?

RustTokioasync

How does it compare?

google/tarpckamiyaa/joshutotouchhle/touchhle
Stars3,6963,6983,699
LanguageRustRustRust
Setup difficultymoderateeasyeasy
Complexity3/52/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires familiarity with Rust async and Tokio, add tarpc and tokio to Cargo.toml and configure a transport layer.

MIT licensed, use freely for any purpose, including commercial projects, as long as you keep the copyright notice.

In plain English

Tarpc is a library for the Rust programming language that makes it easier to build networked services where one program calls functions in another program running on a different machine. This pattern is called remote procedure calls, or RPC. It is common in server software where you have multiple services that need to talk to each other, and each service handles a specific job. The library's main selling point is simplicity. You define your service using ordinary Rust code rather than a separate description language. Many RPC frameworks require you to write your service definition in a special file format, run a separate tool to generate code from it, and then write your actual logic in yet another file. Tarpc skips that step: you write one trait definition annotated with a single attribute, and the library generates the client and server code for you. Several practical features are built in. Requests have deadlines, defaulting to 10 seconds, and the server automatically stops working on a request once its deadline passes. If a client cancels a request partway through, that cancellation propagates through any downstream requests the server was making on the client's behalf. The library also includes distributed tracing support, which lets you follow a single request through multiple services to understand where time is being spent. Tarpc is designed to work with Tokio, Rust's most widely used library for writing asynchronous code. The transport layer is pluggable: you can use network connections for real deployments or in-memory channels for testing. Note that despite being hosted under Google's GitHub organization, the project's README explicitly states it is not an official Google product. It is MIT licensed and maintained as an independent open-source project.

Copy-paste prompts

Prompt 1
Show me how to define and implement a simple tarpc service in Rust that accepts a string and returns a greeting, with both the server and client in one file.
Prompt 2
Using tarpc, how do I set a custom per-request deadline and handle the server stopping work when that deadline expires?
Prompt 3
Set up a tarpc service in Rust that I can test with in-memory channels and then deploy over TCP. Show the minimal difference between the two setups.
Prompt 4
How do I propagate client cancellation through two chained tarpc services in Rust so that downstream work stops when the original caller drops the request?
Prompt 5
Integrate tarpc with tokio-tracing to attach distributed trace IDs to all RPC calls between two Rust services.

Frequently asked questions

What is tarpc?

Rust library for calling functions in remote services over the network using plain Rust traits, with no code generation step or separate description language required.

What language is tarpc written in?

Mainly Rust. The stack also includes Rust, Tokio, async.

What license does tarpc use?

MIT licensed, use freely for any purpose, including commercial projects, as long as you keep the copyright notice.

How hard is tarpc to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is tarpc for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub google on gitmyhub

Verify against the repo before relying on details.