pub trait HasHeaders {
// Required method
fn headers(&self) -> &HeaderMap;
}Expand description
Trait for types that provide access to HTTP headers.
Implement this trait to enable header predicates on custom types.
Both CacheableHttpRequest and
CacheableHttpResponse implement this trait.
§For Implementors
Return a reference to the headers associated with the HTTP message. The returned headers should reflect the current state of the message and remain valid for the lifetime of the borrow.
§For Callers
Use this trait to access headers generically from either requests or responses. Header predicates use this to inspect headers without knowing the concrete message type.