| Crates.io | hyperstack-macros |
| lib.rs | hyperstack-macros |
| version | 0.3.5 |
| created_at | 2026-01-09 05:37:31.179398+00 |
| updated_at | 2026-01-24 05:37:40.678346+00 |
| description | Proc-macros for defining HyperStack streams |
| homepage | |
| repository | https://github.com/HyperTekOrg/hyperstack.git |
| max_upload_size | |
| id | 2031624 |
| size | 528,218 |
Procedural macros for defining HyperStack streams.
This crate provides the #[hyperstack] attribute macro that transforms annotated Rust structs into full streaming pipeline specifications, including:
[dependencies]
hyperstack-macros = "0.2"
use hyperstack_macros::{hyperstack, Stream};
#[hyperstack(idl = "idl.json")]
pub mod my_stream {
#[entity(name = "MyEntity")]
#[derive(Stream)]
struct Entity {
#[map(from = "MyAccount", field = "value")]
pub value: u64,
#[map(from = "MyAccount", field = "owner")]
pub owner: String,
}
}
#[hyperstack(proto = ["events.proto"])]
pub mod my_stream {
// entity structs
}
| 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 |
The macro generates:
{EntityName}State struct with all fieldsfields:: module with field accessorscreate_spec() function returning TypedStreamSpecApache-2.0