Skip to main content

encode_response

Function encode_response 

Source
pub fn encode_response(
    request: &WireRequest,
    answers: &IndexMap<String, Answer>,
) -> Result<Value, Error>
Expand description

Encode normalized answers, excluding the optional Answer::raw payload. Schema 1 projects only the first answer’s call. The answer set must exactly cover the decoded request. This is a projection of already-normalized answers; call the checked provider boundary first to apply the request thresholds. Existing abstentions are preserved.

§Errors

Returns InvalidResponse for missing/extra or incompatible answers, Unsupported for Box values/questions, or a numeric conversion error.