pub type CowHeaderMap = HashMap<CowHeaderName, HeaderValues>;Expand description
Header map using Cow<’static, str> keys for zero-allocation header names.
§Performance
For common headers (Content-Type, Authorization, etc.), the key is a borrowed static string reference. For unknown headers, the key is an owned String. This avoids ~95% of header name allocations in typical HTTP traffic.
§Example
use sentinel_agent_protocol::headers::{CowHeaderMap, HeaderValues, intern_header_name};
let mut headers = CowHeaderMap::new();
headers.insert(
intern_header_name("content-type"),
HeaderValues::from_iter(["application/json".to_string()])
);Aliased Type§
pub struct CowHeaderMap { /* private fields */ }