Expand description
§atlas Proc Macros
atlas-proc-macros is a collection of procedural macros designed to
simplify and enhance Rust-based development for Solana programs using the
atlas framework. This crate provides macros for generating
deserialization implementations, instruction decoders, and type conversions.
§Overview
The macros in this crate are intended to streamline common patterns
encountered when working with atlas, particularly around deserialization,
instruction decoding, and structuring custom types. By leveraging
atlas-proc-macros, you can reduce the amount of manual coding and ensure
consistent, performant handling of Solana-specific data structures.
§Key Features
AtlasDeserialize: Automatically implement theAtlasDeserializetrait for structs and enums, enabling Borsh-based deserialization with optional discriminators for type validation.Instruction Decoder Collection: Create and manage complex instruction decoders for multiple Solana programs, simplifying how instructions are parsed and categorized.InstructionTypeDerivation: DeriveInstructionTypeenums that mirror existing enum structures, providing a simplified, data-free version of each variant.
§Usage
To use any of the provided macros, simply import the desired macro into your Rust program and apply it to the relevant struct or enum.
§Notes
- This crate relies on the
borshlibrary for serialization and deserialization, so ensure the relevant dependencies are included in your project. - The macros provided are optimized for use within the atlas framework.
§Contribution
Contributions are welcome! If you have ideas for improving or expanding the
functionality of atlas_macros, please consider submitting a pull request
or opening an issue on the project’s GitHub repository.
Macros§
- instruction_
decoder_ collection - Generates a collection of instruction decoders and associated enums.
Derive Macros§
- Atlas
Deserialize - Automatically generates an implementation of the
AtlasDeserializetrait. - Instruction
Type - Derives a corresponding
InstructionTypeenum for a given enum.