Skip to main content

Crate arete_macros

Crate arete_macros 

Source
Expand description

§arete-macros

Procedural macros for defining Arete streams.

This crate provides the #[arete] 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

§Module Usage (IDL-based)

use arete_macros::{arete, Stream};

#[arete(idl = "idl.json")]
pub mod my_stream {
    #[entity(name = "MyEntity")]
    #[derive(Stream)]
    struct Entity {
        #[map(from = "MyAccount", field = "value")]
        pub value: u64,
    }
}

§Supported Attributes

  • #[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

Attribute Macros§

arete
Process a #[arete(...)] attribute.

Derive Macros§

Stream
Derive macro for Stream.