#strict-encoding #proc-macro

macro rgb-strict-encoding-derive

Strict encoding derivation macros

3 releases (stable)

1.0.1 Mar 20, 2026
1.0.0 Nov 27, 2025
0.1.0 Nov 26, 2025

#5 in #strict-encoding

Download history 7/week @ 2025-12-07 20/week @ 2025-12-14 16/week @ 2025-12-21 10/week @ 2025-12-28 21/week @ 2026-01-04 109/week @ 2026-01-11 32/week @ 2026-01-18 16/week @ 2026-01-25 22/week @ 2026-02-01 8/week @ 2026-02-08 22/week @ 2026-02-15 28/week @ 2026-02-22 63/week @ 2026-03-01 117/week @ 2026-03-08 235/week @ 2026-03-15 197/week @ 2026-03-22

619 downloads per month
Used in 11 crates (via rgb-strict-encoding)

Apache-2.0

47KB
913 lines

Derivation macros for strict encoding. To learn more about the strict encoding please check strict_encoding crate.

Derivation macros

Library exports derivation macros #[derive(StrictEncode)], #[derive(StrictDecode)], which can be added on top of any structure you'd like to support string encoding (see Example section below).

Encoding/decoding implemented by both of these macros may be configured at type and individual field level using #[strict_type(...)] attributes.

Attribute

StrictEncode and StrictDecode behavior can be customized with #[strict_encoding(...)] attribute, which accepts different arguments depending to which part of the data type it is applied.

Attribute arguments at type declaration level

Derivation macros accept #[strict_encoding()] attribute with the following arguments:


Strict encoding derivation macros

Derivation macros for strict encoding. To learn more about the strict encoding please check rgb-strict-encoding crate.

Contributing

Contribution guidelines can be found in CONTRIBUTING

Licensing

The libraries are distributed on the terms of Apache 2.0 opensource license. See LICENCE file for the license details.

Dependencies

~1.5MB
~42K SLoC