1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! # rustapi-view
//!
//! Template rendering support for the RustAPI framework using Tera templates.
//!
//! This crate provides server-side HTML rendering with type-safe template contexts,
//! layout inheritance, and development-friendly features like auto-reload.
//!
//! ## Features
//!
//! - **Tera Templates**: Full Tera template engine support with filters, macros, and inheritance
//! - **Type-Safe Context**: Build template context from Rust structs via serde
//! - **Auto-Reload**: Development mode can auto-reload templates on change
//! - **Response Types**: `View<T>` response type for rendering templates
//! - **Layout Support**: Template inheritance with blocks
//!
//! ## Quick Start
//!
//! ```rust,ignore
//! use rustapi_rs::prelude::*;
//! use rustapi_view::{View, Templates};
//! use serde::Serialize;
//!
//! #[derive(Serialize)]
//! struct HomeContext {
//! title: String,
//! user: Option<String>,
//! }
//!
//! async fn home(templates: State<Templates>) -> View<HomeContext> {
//! View::render(&templates, "home.html", HomeContext {
//! title: "Welcome".to_string(),
//! user: Some("Alice".to_string()),
//! })
//! }
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
//! let templates = Templates::new("templates/**/*.html")?;
//!
//! RustApi::new()
//! .state(templates)
//! .route("/", get(home))
//! .run("127.0.0.1:8080")
//! .await
//! }
//! ```
pub use ContextBuilder;
pub use ViewError;
pub use ;
pub use View;
// Re-export tera types that users might need
pub use Context;
/// Prelude module for convenient imports