Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Feature Matrix

Scannable map of capabilities. Use the More links for samples and tests.

FeatureWhat it doesHow to use / more
build.rs codegenCompile-time schema → Rust module in OUT_DIRgenerate_to_out_dir("schemas/….xml", config)? · plain include! or sbe_mod!(name) · Quick start · codegen examples
Wire compatibilitySame on-wire layout as official SBEDual encode ergo vs sbe-tool · sbe_tool_wire_parity_test · golden fixtures · Benchmarks · baseline_test
Flyweight decodeZero-copy over &[u8]CarDecoder::try_from(buf)?; car.serial_number() · feature-tour
Composite wire image#[repr(transparent)] Engine([u8; N]) + LE accessors; flyweight defaultNot a repr(C) overlay · Core ideas · composite_layout_test
Per-field vs whole structFlyweight or *FixedFields / *DomainSingle field: flyweight · always fill fixed block: .fixed(&CarFixedFields { … }) · whole message owned: CarDomain · Core ideas · feature-tour
Stage-struct encode + closuresWire order as named monomorphic stages; groups via nested closuresbids(n, |g| g.add(|e| …))? · wrong order = missing method · Core ideas · Recipes · Benchmarks
Consuming decode stagesDistinct after-stage decoder typesinto_bids(|lvl| …)? → into_asks(…)? → var-data · l3_consuming_stages_test
Decoder lanesRandom-access getters, staged into_*/skip_*, ordered callbacks, .memoized()Any-order &Decoder, wire-order walk, or one callback per tail · decode stages
Staged group shapeEntries with their own tails take a visit closure returning the entry’s completion; fixed-stride entries yield an iteratorOne pass either way — the completion is the next cursor, and fixed stride needs no measuring · Iterator only for &mut Iter, so for e in iter cannot drop the message tail · decode stages · l3_consuming_stages_test
Ordered lane (decoder.ordered())Callbacks in wire order at message and nested-entry level as sbe_rt::Ordered<S>; EntryInfo { index, count, block_length } per entryFaçade over the staged stages — same single traversal, same compile-time tail order · message fixed takes a fixed-fields-only view · callbacks return DecodeError · nested ordered() returns the parent completion directly · message chain ends on encoded_length_with_header() · decode stages · ordered_lane_test
Non-advancing counts and lengths<group>_count() / <field>_len() return Result<usize, DecodeError> without consuming a stageBase decoder, .memoized(), the immediately preceding stage, and group entries · 0 for absent versioned tails · iter.remaining_entries() returns usize · an existing primary getter suppresses the colliding convenience accessor (same yield for entry acting_* and ordered fixed) · decode stages
Three-tier constructorstry_* → Result; bare wrap panics if short; bare decode panics if short and Err on wrong template/schema; unsafe *_uncheckedCarDecoder::try_decode(buf, 0)? · CarDecoder::verify(buf)? · demo_try_vs_trusted · Trust boundary
Placement metadataBuffer utils on get_metadata() so field names remaining / buffer / limit / message_offset stay natural (no _field rename)dec.get_metadata().remaining() · schema field remaining → dec.remaining() · Generated code · reserved_name_clash_test
Exact buffer sizingSchema-aware length for nested/ragged msgs — no hand-calculated sizescompute_length_with_header() (fixed) · compute_length_with_header(…) (flat) · *EncodedLength (nested) · Core ideas · l3-book · encoded_length_api_test
Schema docs → rustdocXML descriptions become item docsdescription="…" / <description> / <comment> / <!-- --> · schema_docs_provenance_test
Display / DebugDiagnostic print (not wire format)println!("{car}"); · Display / Debug · demo_display_debug
NULL / MIN / MAXSchema sentinels as constsMODEL_YEAR_NULL · baseline_test
Version-aware fieldssinceVersion / acting versionOption or skip on older wire · baseline_test · multi_schema_versioning_test
Groups / nested groupsRepeating dimensionsbids(n, |g| g.add(…))? · l3-book · l3_orderbook_test
Bulk group encode / decodebulk_add(&[Entry]) / bulk_add_domain(&[EntryDomain]) / bulk_decode() -> Vec<Entry> for eligible flat groupsDTO re-encode selects the domain bulk path automatically when wire and domain fields match; measure against per-entry add() for your schema · group_encode_bench
Var-data / textLength-prefix; optional UTF-8/ASCIImanufacturer_as_str("Honda")? when a characterEncoding is declared, else manufacturer(b"Honda")? · feature-tour
Fixed arrays + bulk helpersArrays, put, pad string, copy-output_some_numbers(…) · vehicle_code_str · copy_vehicle_code · java_parity_features_test
Enums / sets / boolWire enums, bitsets, _boolavailable() / available_bool(true) · comprehensive_test
with_conversionWire type → any app type you implprice_from(&Cents)? / price_as::<Cents>()? · Configuration · exchange-example
with_domain_typeWire type → one fixed Rust pathenc.price(d)?; let d = dec.price()? · l3-book · Configuration
Generated enum / composite mappingsSBE enum → your enum, composite → your struct, with renames; exhaustive both ways; NullVal and unknown values are MappingError::NullEnum.with_enum_mapping(EnumMapping::new("Side", "app::Side")) · .with_composite_mapping(CompositeMapping::new("Leg", "app::Leg")) · App Types · type_mapping_test
Source traitsEncode your own type, groups and var-data included, with no DTO and no allocation.with_source_traits(true) · enc.encode_from(&order)? · Flyweight vs whole struct · source_trait_test
Send helpersClaim → encode → check length and header → commit, aborting on any failure; try-claim or offer transportsOrderEncoder::send(claim, |enc| …)? · send_fixed · sbe_rt::OfferClaim · Aeron try_claim · claim_send_test
Domain DTOsOwned structs + re-encode; allocation-free automatic bulk write for eligible flat groups; var-data via [DomainVarData].with_domain_objects(DomainVarData::Strings) · Domain DTOs · domain_objects_test
AnyMessage + framesMulti-template + framed streamsAnyMessage::try_decode (bare decode is the same path today) · FrameCursor · demo_any_message
verifyFull tail bounds check (associated)CarDecoder::verify(buf)? · demo_try_vs_trusted
Schema identityId / version / hashesSCHEMA_ID, SCHEMA_HASH, SCHEMA_SHA256_HEX · generated module header
Multi-schema shared typesDedup across packages.with_shared_module + generate_multi · exchange-example · multi_schema_versioning_test
Keyword-safe namestype → type_.with_keyword_append_token("_") · java_parity_features_test
XSD-shaped validationOpt-in stricter check for schema authorsvalidate_against_sbe_xsd / parse_with_xsd_validation · xsd.rs
Zero-alloc hot pathFlyweights + caller buffers; bulk_decode() -> Vec and DomainVarData::Strings do allocateallocation_count_test
Property round-tripRandom messages encode→decodecargo test -p ergo-sbe --test proptest_roundtrip · proptest_roundtrip
NullVal → Option<T>Enum NullVal mapped to Option; wire-identical.with_null_as_option(…) / .with_all_enums_as_option() — dec.code() -> Option<EventCode> · DTO None writes NullVal; bulk encode uses the same mapping · NullVal design note · Domain DTOs
Domain var-data typesCompactString (≤24B inline), SmolStr (O(1) clone), bytes::Bytes (shared).with_domain_objects(DomainVarData::CompactStrings) — feature-gated: compact_str, smol_str, bytes · Feature integrations
Codec-level type accessorsinto_<field>_as_compact_str() / _as_smol_str() / _as_bytes() on consuming stagesFeature-gated behind compact_str, smol_str, bytes · Feature integrations
Chrono timestampsDateTime<Utc> / NaiveDateTime from uint64 + semanticType.with_domain_type(ConversionSelector::semantic_type("UTCTimestamp"), "chrono::DateTime<chrono::Utc>") — feature-gated: chrono · Timestamps
Lean constructorGenerationConfig::lean("minimal") — no Display/Debug/dispatch, explicit settings preservedlean() shorthand for new().profile(Lean) · GenerationConfig
Must-use lifecycle#[must_use] on SessionBuilder, AsyncClusterConnect, ClusterClaimCompile-time guard against discarded builder/connect/claim · SessionBuilder
PayloadTooLargeTyped error when header+payload exceeds Aeron maxClusterError::PayloadTooLarge { operation, requested, maximum } · Cluster client
Zero-alloc offer_partsFragmented path uses offer_parts gather — no heap, no payload copyStack header + borrowed payload · Cluster client
checked_deadlineFallible deadline: rejects zero/overflowClusterError::InvalidTimeout · Cluster client