htmx_types/headers/
request.rs

1//! htmx request headers.
2
3use http::Uri;
4
5use super::{convert_header, define_header, string_header, true_header};
6
7true_header! {
8    /// indicates that the request is via an element using [hx-boost](https://htmx.org/attributes/hx-boost/)
9    (HX_BOOSTED, HxBoosted, "hx-boosted")
10}
11
12convert_header! {
13    /// the current URL of the browser
14    Uri => (HX_CURRENT_URL, HxCurrentUrl, "hx-current-url")
15}
16
17true_header! {
18    /// “true” if the request is for history restoration after a miss in the local history cache
19    (HX_HISTORY_RESTORE_REQUEST, HxHistoryRestoreRequest, "hx-history-restore-request")
20}
21
22string_header! {
23    /// the user response to an hx-prompt
24    (HX_PROMPT, HxPrompt, "hx-prompt")
25}
26
27true_header! {
28    /// always “true”
29    (HX_REQUEST, HxRequest, "hx-request")
30}
31
32string_header! {
33    /// the `id` of the target element if it exists
34    (HX_TARGET, HxTarget, "hx-target")
35}
36
37string_header! {
38    ///	the `name` of the triggered element if it exists
39    (HX_TRIGGER_NAME, HxTriggerName, "hx-trigger-name")
40}
41
42string_header! {
43    /// the `id` of the triggered element if it exists
44    (HX_TRIGGER, HxTrigger, "hx-trigger")
45}