sized-data-derive
Procedural macro implementation for sized-data crate, used with Solana's Anchor framework.
Implementation
Automatically derives the SizedData trait for structs by:
- Analyzing struct fields at compile time
- Generating size calculation code for each field
- Producing a total size implementation
// Generates:
Supported Field Types
- Named fields (
struct Example { field: Type }) - Unnamed fields (
struct Example(Type)) - Unit structs (
struct Example;)
Requirements
- Rust 1.83.0+
- quote = "1.0"
- syn = { version = "1.0", features = ["full"] }
Usage
This crate is typically used as a dependency of sized-data. Direct usage:
[]
= "0.1.1"
use SizedData;
License
MIT License