ergo-sbe
ergo-sbe generates Rust SBE codecs with compile-time wire-order enforcement,
closure-based groups, exact buffer sizing, and zero heap allocation on hot
paths. Wire compatibility with official SBE is claimed for the shapes the
dual-encode parity suite exercises — see the normative
compatibility profile
— not as an unqualified "implements every SBE edge case".
AI assistance. Large parts of this project were written with heavy AI assistance. Humans directed the work, approved designs, and ran verification. Details: AI-ASSISTANCE.md.
Full documentation
ergo-sbe book is the comprehensive guide for ergo-sbe (also linked from this crate on docs.rs):
- Getting Started — depend, generate, encode, decode
- Feature Tour — exact sizing, bulk arrays, decode stages, DTOs, trust boundaries
- Core Concepts — wire order, buffer sizing, composites, flyweight vs struct
- Configuration —
with_conversionvswith_domain_type, hooks - Recipes — Display/Debug, schema→rustdoc, domain DTOs, timestamps
- Benchmarks — parity methodology and gates
Compatibility profile (normative):
docs/SBE_COMPATIBILITY.md
— do not claim unqualified “SBE binary compatibility.”
Constructors: book Trust Boundary
— three tiers: try_* (Result), bare names (panic if short), unsafe *_unchecked.
Placement utils: buffer positions (remaining / buffer / limit /
message_offset) live on dec.get_metadata(), not the decoder type — migrate
dec.remaining() → dec.get_metadata().remaining(). A schema field named
remaining keeps the natural accessor dec.remaining(). See book
Generated code — metadata.
Quick Example
use ;
API Reference
docs.rs/ergo-sbe — generated Rustdoc for the published crate.
License
Apache-2.0.