hyperstack-macros
Procedural macros for defining HyperStack streams.
Overview
This crate provides the #[hyperstack] attribute macro that transforms annotated Rust structs into full streaming pipeline specifications, including:
- State struct generation with field accessors
- Handler creation functions for event processing
- IDL/Proto parser integration for Solana programs
- Automatic AST serialization for deployment
Installation
[]
= "0.2"
Usage
IDL-based Stream
use ;
Proto-based Stream
Supported Attributes
| Attribute | Description |
|---|---|
#[map(...)] |
Map from account fields |
#[from_instruction(...)] |
Map from instruction fields |
#[event(...)] |
Capture instruction events |
#[snapshot(...)] |
Capture entire source data |
#[aggregate(...)] |
Aggregate field values |
#[computed(...)] |
Computed fields from other fields |
#[derive_from(...)] |
Derive values from instructions |
Generated Output
The macro generates:
{EntityName}Statestruct with all fieldsfields::module with field accessorscreate_spec()function returningTypedStreamSpec- Handler creation functions for each source
License
Apache-2.0