tower_helmet/header/
x_dns_prefetch_control.rs1use http::header::{HeaderName, InvalidHeaderValue};
2use http::HeaderValue;
3
4use crate::IntoHeader;
5
6#[derive(Debug, Clone, Copy, Default)]
9pub struct XDnsPrefetchControl(
10 pub bool,
12);
13
14impl IntoHeader for XDnsPrefetchControl {
15 fn header_name(&self) -> HeaderName {
16 http::header::X_DNS_PREFETCH_CONTROL
17 }
18
19 fn header_value(&self) -> Result<HeaderValue, InvalidHeaderValue> {
20 HeaderValue::from_str(if self.0 { "on" } else { "off" })
21 }
22}