Skip to main content

transform_response

Function transform_response 

Source
pub fn transform_response(
    src_operation: OperationFamily,
    src_protocol: ProtocolKind,
    dst_operation: OperationFamily,
    dst_protocol: ProtocolKind,
    body: Vec<u8>,
) -> Result<Vec<u8>, TransformError>
Expand description

Transform a response body from upstream protocol back to client protocol.

When a client sends request in (src_op, src_proto) and upstream responds in (dst_op, dst_proto), we need to convert the upstream response back to the client’s protocol. The key is looked up as (dst_op, dst_proto, src_op, src_proto) because we’re converting FROM the upstream format TO the client format.