Skip to main content

Crate truthlinked_sdk_macros

Crate truthlinked_sdk_macros 

Source
Expand description

Procedural macros for the TruthLinked SDK.

This crate provides derive macros and attribute macros for smart contract development:

  • #[derive(Event)] - Generates event emission code
  • #[derive(BytesCodec)] - Generates variable-length encoding/decoding
  • #[derive(Codec32)] - Generates 32-byte encoding/decoding
  • #[derive(Manifest)] - Generates storage access manifests
  • #[error_code] - Defines error code constants
  • #[require] - Assertion macro with custom error codes

Attribute Macros§

error_code
Attribute macro for defining error code enums.
require
Attribute macro for adding precondition checks to functions.

Derive Macros§

BytesCodec
Derives the BytesCodec trait for variable-length encoding.
Codec32
Derives the Codec32 trait for 32-byte fixed-size encoding.
Event
Derives the Event trait for structured logging.
Manifest
Derives the Manifest trait for storage access declarations.