Crate solders_macros

source ·
Expand description

A collection of attribute macros to reduce boilerplate in the solders project.

These macros make some very specific assumptions about the structs they’re applied to, so they’re unlikely to be useful for other projects.

Attribute Macros§

  • Add __bytes__, __str__, __repr__ and __reduce__, to_json and from_json using the CommonMethods trait.
  • Add __bytes__, __str__, __repr__ and __reduce__ using the CommonMethodsCore trait.
  • Add __bytes__, __str__, __repr__, __reduce__, to_json, from_json, from_bytes and __richcmp__ using the CommonMethodsRpcResp trait.
  • Add mappings to and from another enum that has the exact same fields.
  • Add a __hash__ to the impl using the PyHash trait.
  • Add a __richcmp__ to the impl using the RichcmpEqualityOnly trait.
  • Add a __richcmp__ to the impl using the RichcmpFull trait.
  • Add a __richcmp__ to the impl using the RichcmpSigner trait.
  • Add an id getter to an RPC request object.

Derive Macros§

  • Impl IntoPy for an ADT where each variant is a newtype.