Skip to main content

envelope

Function envelope 

Source
pub(crate) fn envelope(id: &Value, result: Value) -> Value
Expand description

Wrap a result body in its JSON-RPC envelope.

An error body is hoisted to the top-level error member; anything else becomes result. A response carries one or the other, never both.