pub trait HeaderNameAlg {
const HEADER_NAME: &'static str;
}
macro_rules! header_names {
($($marker:ident => $name:literal),+ $(,)?) => {
$(
#[doc = concat!("States the `", $name, "` header an answer carries.")]
#[derive(Debug, Default)]
pub struct $marker;
impl HeaderNameAlg for $marker {
const HEADER_NAME: &'static str = $name;
}
)+
};
}
header_names! {
CacheControl => "cache-control",
ContentDisposition => "content-disposition",
ContentLanguage => "content-language",
ETag => "etag",
Expires => "expires",
LastModified => "last-modified",
Link => "link",
Location => "location",
RetryAfter => "retry-after",
Vary => "vary",
}