use super::headers::*;
use {http::*, std::time::*};
pub const XX_CACHE: HeaderName = HeaderName::from_static("xx-cache");
pub const XX_CACHE_DURATION: HeaderName = HeaderName::from_static("xx-cache-duration");
pub const XX_ENCODE: HeaderName = HeaderName::from_static("xx-encode");
pub trait CustomHeaderValues {
fn xx_cache(&self, default: bool) -> bool;
fn xx_cache_duration(&self) -> Option<Duration>;
fn xx_encode(&self, default: bool) -> bool;
}
impl CustomHeaderValues for HeaderMap {
fn xx_cache(&self, default: bool) -> bool {
self.bool_value(XX_CACHE, default)
}
fn xx_cache_duration(&self) -> Option<Duration> {
self.duration_value(XX_CACHE_DURATION)
}
fn xx_encode(&self, default: bool) -> bool {
self.bool_value(XX_ENCODE, default)
}
}