prost

A Protocol Buffers implementation for Rust that generates simple, idiomatic types via derive macros.

Library
Cargo
v0.14.4
4,741stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
79/100Good
Development Activity72
Maintenance72
Community72
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
85/100Excellent
Architecture88
Code Quality90
Innovation82
Learning Curve78

Prost is a Protocol Buffers implementation for the Rust language, generating clean, idiomatic Rust code directly from proto2 and proto3 .proto files. Rather than emitting large generated modules full of boilerplate, Prost leans on Rust’s derive-macro system so .proto messages become plain structs annotated with #[derive(Message)], oneofs become enums, and comments from the source .proto files are preserved in the generated docs.

Maintained under the Tokio project umbrella, Prost is the de facto Protobuf implementation for the Rust ecosystem and is the code-generation layer beneath gRPC libraries like tonic. It supports no_std environments, preserves unknown enum values on deserialization (important for forward-compatible wire formats), and uses the bytes crate’s Buf/BufMut abstractions instead of std::io::{Read, Write} for zero-copy-friendly encoding and decoding.

What You Get

  • The prost runtime crate: Message, Enumeration, and Oneof derive macros plus the Message trait (encode, decode, encoded_len, and buffer-based variants) for any type annotated with #[derive(Message)]
  • prost-build, a build-script library that invokes protoc (or a pure-Rust protoc-free path) to compile .proto files into Rust modules during cargo build
  • prost-types, ready-made Rust bindings for the Protobuf well-known types (Any, Timestamp, Duration, Struct, etc.)
  • Preservation of .proto comments as Rust doc comments on generated types, plus package-to-module mapping (package foo.bar becomes the foo::bar Rust module)
  • no_std support (disable the std feature) so Prost can be used in embedded and constrained environments
  • A BTreeMap configuration option in prost-build for deterministic, allocation-conscious map encoding instead of HashMap

Common Use Cases

  • Generating Rust request/response types for gRPC services when paired with tonic as the RPC transport
  • Encoding/decoding a stable, versioned wire format for cross-service or cross-language communication (Rust services talking to Go, Java, Python, or C++ peers over Protobuf)
  • Persisting structured records in a compact binary format for storage or message-queue payloads where JSON’s size and stringliness are undesirable
  • Building no_std firmware or embedded systems that need a compact, cross-language-compatible message format without pulling in std
  • Emitting a FileDescriptorSet for runtime introspection tooling that needs the original .proto schema shape alongside generated code

Under The Hood

Architecture: The workspace splits cleanly along a build-time/runtime boundary. prost-build (a separate crate invoked from a consuming project’s build.rs) shells out to protoc to parse .proto files into a FileDescriptorSet, then walks that descriptor tree to emit Rust source implementing the Message trait for each message type. At runtime, the prost crate itself is deliberately small: src/message.rs defines the core Message trait (encode_raw, merge_field, encoded_len, plus default-provided encode/decode/encode_to_vec methods), src/encoding.rs (1,462 lines) implements the actual varint/length-delimited wire encoding for every Protobuf scalar and collection shape via macro-generated encode/merge/encoded_len function families, and src/types.rs plus the separate prost-types crate supply the well-known-type bindings. prost-derive is the proc-macro crate that reads struct/enum field attributes (emitted by prost-build) and generates the actual Message/Enumeration/Oneof trait implementations, closing the loop between build-time codegen and runtime behavior. Tech Stack: Pure Rust workspace (Cargo.toml lists prost, prost-build, prost-derive, prost-types, plus dedicated tests, tests-2015/2018/2024, and tests-no-std crates for edition and no_std compatibility matrices). The only runtime dependency of the core prost crate is bytes (for Buf/BufMut); prost-derive is an optional dependency gated behind the derive feature (on by default). MSRV is pinned at Rust 1.85 with a documented six-month rolling policy. Dev-dependencies include criterion for benchmarking varint encoding and proptest/rand for property-based testing. Code Quality: The crate carries a dedicated tests workspace member (with prost-path, reexported-prost, and single-include sub-crates) exercising re-export and path-independence scenarios, alongside edition-specific test crates (tests-2015, tests-2018, tests-2024) and a tests-no-std crate proving the no_std feature actually compiles without std. A fuzz/ directory plus FUZZING.md and KANI.md document both libFuzzer-based fuzz targets and formal verification via the Kani model checker — an unusually rigorous quality bar for a serialization library where malformed input handling is a real attack surface. DecodeError in src/error.rs tracks a ‘best effort’ error description plus a (message, field) name stack for nested decode failures, giving actionable error context rather than an opaque failure. CI (.github/workflows/ci.yml, cifuzz.yml) runs the full matrix on every push. API Design: The public surface centers on one trait (Message) and three derive macros, keeping the mental model small: annotate a struct, call .encode()/Message::decode(). Scalar-to-Rust-type mapping (int32 to i32, bytes to Vec<u8>, etc.) follows Rust conventions rather than inventing new wrapper types, and generated oneofs become plain Rust enums matched with match. The tradeoff for this simplicity is that some internal-use methods (encode_raw, merge_field) are #[doc(hidden)] but technically public, and the README explicitly flags a deprecated DecodeError::new that leaked into public API by accident — an honest, documented rough edge rather than a silent trap.

Used by 10 apps in this directory

TypeScript
51%
MIT

Anarlog

Note Taking · AI Assistants · Productivity

9,087

Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.

View details
86
Repo Health
77
Technical
69
Dependency
Built with
TypeScript51%
Rust38%
Updated today
Rust
100%
Other

Fluree DB

Databases

445

A temporal, verifiable graph database with git-like branching, integrated vector/text/geo search, and RDF/SPARQL/JSON-LD/openCypher support — benchmarked at 10.4x faster than the next database on the full Wikidata dump.

View details
86
Repo Health
74
Technical
65
Dependency
Built with
Rust100%
Updated yesterday
Rust
41%
Other

Hook0

Devops

1,477

Open-source Webhooks-as-a-Service: deliver events to your users with auto-retry, signed payloads, and a real-time subscriber dashboard — all without building the infrastructure yourself.

View details
83
Repo Health
82
Technical
70
Dependency
Built with
Rust41%
TypeScript17%
JavaScript15%
Updated today
TypeScript
69%
Apache 2.0

Laminar

AI Development · Monitoring

3,180

Open-source observability platform purpose-built for AI agents — trace, evaluate, debug, and monitor at scale with SQL access and real-time replay.

View details
85
Repo Health
76
Technical
70
Dependency
Built with
TypeScript69%
Rust29%
Updated yesterday
Rust
72%
Apache 2.0

mesh-llm

AI Development · AI Agents

3,258

Mesh LLM pools GPUs and memory across every machine you own into one OpenAI-compatible API, so agents tap distributed compute instead of a single GPU box or a metered cloud bill.

View details
83
Repo Health
91
Technical
70
Dependency
Built with
Rust72%
TypeScript16%
Updated today
Rust
96%
Apache 2.0

codex

AI Code Assistants · Developer Tools

106,760

OpenAI's open-source CLI coding agent that reads, edits, and runs code in your terminal using natural language prompts.

View details
89
Repo Health
80
Technical
77
Dependency
Built with
Rust96%
Updated today
Rust
84%
Apache 2.0

OpenShell

AI Agents · Developer Tools

8,270

The safe, private runtime that lets autonomous AI agents operate in sandboxed environments governed by declarative YAML policies — blocking data exfiltration, credential leaks, and unauthorized network activity before they happen.

View details
84
Repo Health
81
Technical
69
Dependency
Built with
Rust84%
Updated today
Rust
87%
AGPL 3.0

ParadeDB

Search · Databases · Analytics

9,175

Born out of Y Combinator's S2023 batch, ParadeDB is a Postgres extension that delivers Elasticsearch-quality BM25 search and real-time analytics without a separate search cluster to manage.

View details
88
Repo Health
87
Technical
71
Dependency
Built with
Rust87%
PLpgSQL12%
Updated today
Go
80%
AGPL 3.0

PeerDB

Data Engineering · Databases

3,241

Postgres-native ETL that streams change data capture in real time to Snowflake, BigQuery, ClickHouse, S3, and Kafka — up to 10x faster than general-purpose pipelines, managed through a familiar Postgres SQL interface.

View details
88
Repo Health
76
Technical
68
Dependency
Built with
Go80%
TypeScript13%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search