topcoat_htmx/lib.rs
1//! [htmx](https://htmx.org) support for Topcoat.
2//!
3//! This crate provides two halves of htmx integration, both built on Topcoat's
4//! request context and response conventions rather than on extractors and
5//! middleware:
6//!
7//! - **Request accessors** ([`hx_request`], [`hx_boosted`], [`hx_target`], ...)
8//! read the [htmx request headers](https://htmx.org/reference/#request_headers)
9//! from a `cx: &Cx`.
10//! - **Responders** ([`HxRedirect`], [`HxRefresh`], [`HxRetarget`],
11//! [`HxResponseTrigger`], ...) implement
12//! [`IntoResponseParts`](topcoat_router::IntoResponseParts), so they
13//! can be placed before the body in a handler's response tuple to set the
14//! corresponding [htmx response headers](https://htmx.org/reference/#response_headers).
15//!
16//! The raw header names are available as constants in the [`header`] module.
17
18pub mod header;
19
20mod location;
21mod request;
22mod response;
23mod swap;
24mod trigger;
25
26pub use location::*;
27pub use request::*;
28pub use response::*;
29pub use swap::*;
30pub use trigger::*;