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
68
69
70
71
72
73
74
75
//! HTMX support for server-rendered applications.
//!
//! This module provides HTMX integration for acton-service, enabling
//! ergonomic development of HTMX-based applications.
//!
//! # Features
//!
//! - **Header Extractors**: Type-safe access to HTMX request headers
//! - **Response Builders**: Convenient response types for HTMX patterns
//! - **Auto-Vary Middleware**: Automatic `Vary` header management for caching
//! - **CSRF Integration**: Works seamlessly with existing CSRF protection
//! - **Fragment Responses**: Helpers for partial HTML responses
//!
//! # Quick Start
//!
//! ```toml
//! [dependencies]
//! acton-service = { version = "0.9", features = ["htmx", "session-memory"] }
//! ```
//!
//! ```rust,ignore
//! use acton_service::prelude::*;
//! use acton_service::htmx::{HxRequest, HtmlFragment};
//!
//! async fn handler(HxRequest(is_htmx): HxRequest) -> impl IntoResponse {
//! if is_htmx {
//! // Return just the fragment for HTMX
//! HtmlFragment("<div>Updated content</div>")
//! } else {
//! // Return full page for regular requests
//! Html(include_str!("templates/full_page.html")).into_response()
//! }
//! }
//! ```
//!
//! # CSRF Integration
//!
//! The session module's CSRF support works seamlessly with HTMX:
//!
//! ```html
//! <head>
//! {{ csrf.as_meta_tag() }}
//! </head>
//! <body hx-headers='{"X-CSRF-Token": "{{ csrf.token() }}"}'>
//! <!-- All HTMX requests will include the CSRF token -->
//! </body>
//! ```
// Custom response types and helpers
pub use ;
pub use ;
// Re-export extractors from axum-htmx
pub use ;
// Re-export response headers from axum-htmx
pub use ;
// Re-export Vary responders from axum-htmx
pub use ;
// Re-export auto-vary middleware from axum-htmx
pub use ;
// Re-export event types
pub use HxEvent;