Skip to main content

encode_trading_command

Function encode_trading_command 

Source
pub fn encode_trading_command(
    command: &TradingCommand,
) -> Result<EncodedPayload, EncodeError>
Expand description

Encodes a [TradingCommand] envelope by dispatching on the variant.

The captured entry’s payload_type matches the inner-variant tag (e.g. SubmitOrder rather than TradingCommand) so forensics scans pair with the same decoder as the bare-type capture path. The serialized payload is the inner variant; the wrapper enum is never written to disk.

§Errors

Returns the inner encoder’s EncodeError for the [TradingCommand::SubmitOrder] variant; other variants return EncodeError::Serialize when MessagePack rejects the inner payload.