Anza (Rust Engine)
A server-side template and dynamic fragment rendering library for Rust web applications.
What It Does
- Full-Page Rendering: Renders complete HTML documents configured with
<template shadowrootmode="open">Declarative Shadow DOM shells. - Dynamic Fragment Envelopes: Renders targeted HTML partials inside JSON
Envelopepayloads for partial UI updates. - Payload Verification: Signs dynamic payloads using HMAC-SHA256 or Ed25519 so clients can verify partial updates.
- Streaming: Helpers for Server-Sent Events (SSE) and WebSocket message formats.
Installation
Add anza to your Cargo.toml:
[]
= "0.5.0"
To enable Axum framework response helpers:
[]
= { = "0.5.0", = ["axum"] }
Usage
1. Initialize Engine
use Arc;
use ;
let engine = new;
2. Render Full Pages
use Page;
// Renders full HTML document with parameters interpolated into slots
let doc = new
.with_param
.run
.expect;
println!;
3. Render Signed JSON Fragments
use Fragment;
// Renders a specific template fragment targeting a slot
let envelope = new
.with_param
.run
.expect;
// envelope contains: slot, html, ts, and signature
let json = to_string.unwrap;
4. Axum Integration Example
use Arc;
use ;
use ;
async
License
MIT © 2026 aduki, Labs