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 an error if the inner encoder rejects the [TradingCommand::SubmitOrder] variant, or if
MessagePack rejects the inner payload for another variant.