Skip to main content

Crate rustbinary_derive

Crate rustbinary_derive 

Source
Expand description

Procedural derives used by rustbinary.

Applications normally enable the matching rustbinary feature and use the derives re-exported by the main crate. Generated paths intentionally refer to ::rustbinary, keeping the runtime traits and wire implementation owned by one crate. The procedural macro runs on the host with std, but generated code uses only core syntax and the selected RustBinary runtime traits, so consumers may expand these derives in no_std crates.

§Macro selection

  • Fingerprint generates a compatibility identifier for type structure and codec configuration.
  • StaticSize generates finite normal and bit-packed size bounds for statically sized values.
  • Reflect generates allocation-free structural metadata.
  • BitPacked generates a checked bit-level codec for bounded fields and nested BitPack values.

The generated implementations are not a replacement for Serde derives. Add Serialize and Deserialize when the value also crosses a normal rustbinary or CBOR wire profile. For the complete syntax and production constraints, see the package README and the re-exported runtime traits.

Derive Macros§

BitPacked
Derives rustbinary::BitPack for structs and enums.
Fingerprint
Derives rustbinary::Fingerprint from structural type metadata.
Reflect
Derives allocation-free structural reflection metadata.
StaticSize
Derives compile-time normal and bit-packed size bounds.