Skip to main content

encode_execution_report

Function encode_execution_report 

Source
pub fn encode_execution_report(
    report: &ExecutionReport,
) -> Result<EncodedPayload, EncodeError>
Expand description

Encodes an [ExecutionReport] envelope by dispatching on the variant.

send_execution_report hands the bus tap an [ExecutionReport] wrapper, so the tap dispatches by the wrapper’s std::any::TypeId and the inner variants never reach their bare-type encoders. The dispatcher unwraps each variant, encodes the inner type with its own index keys, and stamps the inner-variant tag so forensics scans see entries identical to a bare capture path.

The [ExecutionReport::Order] arm reuses encode_order_status_report because the bare-type encoder already exists; the remaining variants delegate to private inner encoders that index the report’s identifiers individually.

§Errors

Returns the inner encoder’s EncodeError when MessagePack rejects the inner payload.