Feature tour
Runnable examples pull live source from sbe-feature-tour (compiled by
docs_validation_test). Schematics that cannot run in the harness stay
rust,ignore.
- Exact sizing:
compute_length_with_headerbefore you encode - Bulk arrays:
bulk_add(&[Entry])for fixed-stride leaf groups - Decoder lanes: random access, staged
into_*, ordered callbacks,.memoized() - What generated code looks like: stages, metadata, reserved names
- Trust boundaries:
try_*returnsResult;wrappanics if short;decodeis hybrid - Domain objects (DTOs): owned snapshots (never on the hot path)
- Multi-template dispatch:
AnyMessageroutes by template ID - Code-generation hooks: append Rust tokens (serde, custom validation) after each generated item
Every feature, one link each
| Area | Feature | Where |
|---|---|---|
| Generate | generate(..) in build.rs, write_to_out_dir / write_to | Generate in build.rs |
| Generate | sbe_mod! / include_sbe! | Include generated code |
| Generate | build vs runtime dependency, generator as a library | Depend on the generator |
| Generate | several schemas, SchemaSource::with_shared, with_shared_module | Multi-schema patterns |
| Generate | parse diagnostics (miette spans, fancy feature) | Error diagnostics |
| Generate | validate_against_sbe_xsd, SchemaSource::with_xsd_validation | Extension XML: what is captured |
| Generate | moving from sbe-tool | Coming from sbe-tool |
| Encode | type-state stages in wire order | Wire order via named stages |
| Encode | method chaining, fixed(&FixedFields) | Method chaining |
| Encode | optional fields, apply_nulls | Encode and decode |
| Encode | exact buffer sizing, *EncodedLength | Buffer sizing |
| Encode | Aeron try_claim: Claim, send_fixed, send, OfferClaim | Aeron try_claim |
| Decode | composites, endianness, layout | Composite layout and endianness |
| Decode | flyweights vs owned structs | Flyweight vs whole-struct |
| Decode | checked entry points, tails checked as reached | Trust boundary |
| Decode | NullVal and Option | Why NullVal instead of Option |
| Decode | Display / Debug text | Display and Debug |
| Decode | schema descriptions as rustdoc | Schema descriptions as rustdoc |
| Config | presets: new, lean, profile(GenerationProfile) | GenerationConfig options |
| Config | with_conversion, with_domain_type, with_manual_domain_type, selectors | with_conversion vs with_domain_type |
| Config | with_enum_mapping, with_composite_mapping | App types on composites |
| Config | with_null_as_option, with_all_enums_as_option | Opting into Option |
| Config | with_bool_domain_type | Null-aware accessors on BooleanType |
| Config | with_domain_objects(DomainVarData) | Domain DTOs |
| Config | compact_str, smol_str, bytes, chrono features | Feature integrations |
| Config | timestamp conversions | Timestamp conversions |
| Config | with_validate | Value validation |
| Config | with_source_traits, with_encode_version, with_external_sbe_rt, with_module_name, with_keyword_append_token, with_deprecated_attrs, with_display_debug, with_meta_attributes, with_dispatch | GenerationConfig options |
| Extend | with_hook, contexts, accessor names and types | Code-generation hooks |
| Extend | with_try_hook, GenerateError::Hook | Hooks that can fail |
| Extend | schema extension marks, any attribute, prefixed or not | Extension XML |
| Extend | with_extension_consts | Every mark as a const |
| Extend | example label and field-pair hooks | Example hooks |
| Extend | ConversionSelector::extension_attr | ExtensionAttr conversions |
| Extend | a venue’s SBE responses rendered as its JSON | Exchange example |
| Reference | type-state cost, API freeze, feature matrix | Type-state, API freeze, Feature matrix |
| Reference | benchmarks against sbe-tool | Benchmarks, Methodology |