Expand description
Atom Engine - A component-oriented template engine for Rust
§Overview
Atom Engine is a high-performance template engine built on Tera with additional features like components, props, slots, and provide/inject context.
§Features
- Built on Tera for robust template parsing and rendering
- Component system with props, slots, and validation
- Provide/Inject context (React-style)
- Stack system for content accumulation
- 50+ built-in filters
- Helper directives (@map, @filter, @each, @reduce)
- Async and parallel rendering support
- Component caching
§Quick Start
use atom_engine::Atom;
use serde_json::json;
let mut engine = Atom::new();
engine.add_template("hello.html", "Hello, {{ name }}!").unwrap();
let result = engine.render("hello.html", &json!({"name": "World"})).unwrap();
assert_eq!(result, "Hello, World!");Modules§
- filters
- Filter modules for Atom Engine.
Structs§
- Atom
- The main template engine struct.
- Component
- A registered component with its template and prop definitions.
- Component
Cache - Cache for rendered components.
- Component
Registry - Registry for managing component templates.
- Component
Renderer - Runtime component renderer that manages slot content and stack buffers.
- Context
Chain - A chain of context layers supporting provide/inject pattern.
- Memory
Pool - A memory pool for managing chunk allocations.
- Pooled
String - A string backed by a pooled buffer.
- PropDef
- Definition of a component prop.
- Scoped
Slot Def - Definition of a scoped slot.
- Slot
Data - Data for slot rendering.
- String
Pool - A pool for managing multiple PooledStrings.
Enums§
Functions§
- compute_
cache_ key - Computes a cache key from component path and props hash.
- compute_
props_ hash - Computes a hash for component props.