Crate tessera_ui_macros

Source
Expand description

§Tessera Macros

This crate provides procedural macros for the Tessera UI framework. The main export is the #[tessera] attribute macro, which transforms regular Rust functions into Tessera UI components.

§Usage

use tessera_ui_macros::tessera;

#[tessera]
fn my_component() {
    // Component logic here
    // The macro provides access to `measure`, `state_handler` and `on_minimize` functions
}

The #[tessera] macro automatically:

  • Registers the function as a component in the Tessera component tree
  • Injects measure, state_handler and on_minimize functions into the component scope
  • Handles component tree management (adding/removing nodes)
  • Provides error safety by wrapping the function body

Attribute Macros§

tessera
The #[tessera] attribute macro transforms a regular Rust function into a Tessera UI component.