Negotiate content encoding from the `accept-encoding` header. Returns the highest q-value encoding that is supported by enabled crate features. Returns [`ContentEncoding::NoOp`] if no supported encoding is found.
(headers: &HeaderMap)
| 41 | /// Returns the highest q-value encoding that is supported by enabled crate features. |
| 42 | /// Returns [`ContentEncoding::NoOp`] if no supported encoding is found. |
| 43 | pub fn from_headers(headers: &HeaderMap) -> Self { |
| 44 | let mut prefer = ContentEncodingWithQValue::default(); |
| 45 | |
| 46 | for encoding in Self::_from_headers(headers, &ACCEPT_ENCODING) { |
| 47 | prefer.try_update(encoding); |
| 48 | } |
| 49 | |
| 50 | prefer.enc |
| 51 | } |
| 52 | |
| 53 | /// Negotiate content encoding from a caller-specified header name. |
| 54 | /// |
nothing calls this directly
no test coverage detected