protowire_pb/lib.rs
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2026 TrendVidia, LLC.
3//! Schema-free protobuf binary codec.
4//!
5//! Port of `github.com/trendvidia/protowire/encoding/pb` and the TS port's
6//! `pb` module. Two layers:
7//!
8//! - [`wire`]: low-level primitives (varint, zigzag, fixed widths, tags,
9//! length-delimited blobs, skip-on-unknown).
10//! - [`codec`]: the [`codec::Message`] trait + nested-message helpers.
11//!
12//! Idiomatic Rust differs from the Go (struct tags via reflection) and TS
13//! (runtime field schemas) ports: each Rust message implements `Message`
14//! by hand. The wire bytes match all five ports per
15//! `protowire/scripts/cross_envelope_check.sh`.
16
17pub mod codec;
18pub mod wire;
19
20pub use codec::{marshal, read_message, unmarshal, write_message, Message};
21pub use wire::{Error, Reader, Result, WireType, Writer};