MCPcopy Create free account
hub / github.com/HFQR/xitca-web / try_decoder

Function try_decoder

http-encoding/src/decode.rs:14–20  ·  view source on GitHub ↗
(headers: &HeaderMap, body: S)

Source from the content-addressed store, hash-verified

12/// Construct from headers and stream body. Use for decoding.
13#[inline]
14pub fn try_decoder<S>(headers: &HeaderMap, body: S) -> Result<Coder<S, FeaturedCode>, EncodingError>
15where
16 S: Body,
17 S::Data: AsRef<[u8]> + 'static,
18{
19 from_headers(headers).map(|decoder| Coder::new(body, decoder))
20}
21
22fn from_headers(headers: &HeaderMap) -> Result<FeaturedCode, EncodingError> {
23 let mut err = None;

Callers 2

callMethod · 0.85
callMethod · 0.85

Calls 2

from_headersFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected