Skip to main content

decode_rpc_body

Function decode_rpc_body 

Source
pub fn decode_rpc_body<C, T>(
    codec: &C,
    headers: &HeaderMap,
    body: &[u8],
) -> Result<T, CoolError>
where C: HttpTransport, T: for<'de> Deserialize<'de>,
Expand description

Decode an RPC unary request body into T, picking the codec based on the request’s Content-Type header. Missing header → CBOR (the default for the REST binding too).

Used by the macro-generated RPC dispatcher; safe to use directly.