Thanks to visit codestin.com
Credit goes to lib.rs

#protobuf #edition #serialization

no-std buffa

A pure Rust Protocol Buffers implementation with first-class editions support

8 releases (5 breaking)

new 0.6.0 May 15, 2026
0.5.2 May 8, 2026
0.4.0 Apr 27, 2026
0.3.0 Apr 1, 2026
0.1.0 Mar 14, 2026

#232 in Encoding

Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

910,060 downloads per month
Used in 56 crates (48 directly)

Apache-2.0

1MB
15K SLoC

buffa

crates.io docs.rs

The runtime crate for buffa — a pure-Rust Protocol Buffers implementation with first-class editions support, zero-copy views, and no_std compatibility.

This crate contains the Message trait, wire-format encode/decode primitives, MessageField / EnumValue / UnknownFields container types, and the zero-copy view layer. Generated code emitted by buffa-build or protoc-gen-buffa depends on this crate.

Quick start

See the workspace README for end-to-end setup with buf generate or build.rs. In short:

use buffa::Message;

let bytes = person.encode_to_vec();
let decoded = Person::decode_from_slice(&bytes)?;

For untrusted input, tighten limits with DecodeOptions:

use buffa::DecodeOptions;

let msg: Person = DecodeOptions::new()
    .with_recursion_limit(50)
    .with_max_message_size(1024 * 1024)  // 1 MiB
    .decode_from_slice(&bytes)?;

Feature flags

Flag Default Enables
std std::io::Read decoders, HashMap for map fields, thread-local JSON parse options
json Proto3 JSON via serde
arbitrary arbitrary::Arbitrary impls for fuzzing

With default-features = false the crate is #![no_std] (requires alloc).

Documentation

Conformance

buffa passes the full protobuf conformance suite for binary and JSON encoding (both std and no_std builds). Text format (textproto) is not supported.

License

Apache-2.0

Dependencies

~1–1.8MB
~31K SLoC