Skip to main content

rama_http_headers/
lib.rs

1//! # Typed HTTP Headers
2//!
3//! rama has the opinion that headers should be strongly-typed, because that's
4//! why we're using Rust in the first place. To set or get any header, an object
5//! must implement the `Header` trait from this module. Several common headers
6//! are already provided, such as `Host`, `ContentType`, `UserAgent`, and others.
7//!
8//! # Why Typed?
9//!
10//! Or, why not stringly-typed? Types give the following advantages:
11//!
12//! - More difficult to typo, since typos in types should be caught by the compiler
13//! - Parsing to a proper type by default
14//!
15//! # Rama
16//!
17//! Crate used by the end-user `rama` crate and `rama` crate authors alike.
18//!
19//! Learn more about `rama`:
20//!
21//! - Github: <https://github.com/plabayo/rama>
22//! - Book: <https://ramaproxy.org/book/>
23
24#![doc(
25    html_favicon_url = "https://raw.githubusercontent.com/plabayo/rama/main/docs/img/rama_logo.svg"
26)]
27#![doc(
28    html_logo_url = "https://raw.githubusercontent.com/plabayo/rama/main/docs/img/rama_logo.svg"
29)]
30#![cfg_attr(docsrs, feature(doc_cfg))]
31#![cfg_attr(test, allow(clippy::float_cmp))]
32
33mod header;
34#[doc(inline)]
35pub use header::{Error, HeaderDecode, HeaderEncode, TypedHeader};
36
37#[macro_use]
38pub mod util;
39
40mod common;
41mod map_ext;
42mod req_builder_ext;
43mod resp_builder_ext;
44
45pub mod exotic;
46pub mod privacy;
47
48pub mod x_robots_tag;
49pub use x_robots_tag::XRobotsTag;
50
51pub mod specifier;
52
53pub use self::common::*;
54pub use self::map_ext::HeaderMapExt;
55pub use self::req_builder_ext::HttpRequestBuilderExt;
56pub use self::resp_builder_ext::HttpResponseBuilderExt;
57
58pub mod encoding;
59pub mod forwarded;
60
61pub mod client_hints;
62pub use client_hints::{
63    AcceptCh, ClientHint, CriticalCh, Downlink, Ect, Rtt, SaveData,
64    all_client_hint_header_name_strings, all_client_hint_header_names, all_client_hints,
65};