Expand description
Representative encoders for the SPEC’s allow-listed message surface.
Phase 6 shipped a sample triple (SubmitOrder command, OrderFilled generated event,
OrderStatusReport raw venue report) so the bus capture adapter had a working
allow-list end-to-end. Phase 7 adds envelope-aware dispatchers for the
wrapper enums production code actually pushes through send_trading_command,
publish_order_event, send_execution_report, and publish_position_event
([TradingCommand], [OrderEventAny], [ExecutionReport], [PositionEvent]).
The same pattern covers send_data_command and send_data_response ([DataCommand],
[DataResponse]). These reach the bus tap as their wrapper std::any::TypeId and
the bare-type registrations would miss them. Each dispatcher unwraps its variant,
runs the inner-typed encode, and stamps the inner-variant’s canonical payload_type
tag so forensics scans see entries identical to the bare-type capture path.
The payload serialization format is MessagePack via rmp-serde. The on-disk envelope
uses the positional codec; MessagePack inside the payload handles the upstream Nautilus
types that carry #[serde(tag = "type")] internal tagging, which a non-self-describing
format cannot round-trip.
Constants§
- PAYLOAD_
TYPE_ ACCOUNT_ STATE - The canonical
payload_typetag for [AccountState]. - PAYLOAD_
TYPE_ BARS_ RESPONSE - The canonical
payload_typetag for [BarsResponse]. - PAYLOAD_
TYPE_ BATCH_ CANCEL_ ORDERS - The canonical
payload_typetag for [BatchCancelOrders]. - PAYLOAD_
TYPE_ BATCH_ MODIFY_ ORDERS - The canonical
payload_typetag for [BatchModifyOrders]. - PAYLOAD_
TYPE_ BOOK_ DELTAS_ RESPONSE - The canonical
payload_typetag for [BookDeltasResponse]. - PAYLOAD_
TYPE_ BOOK_ DEPTH_ RESPONSE - The canonical
payload_typetag for [BookDepthResponse]. - PAYLOAD_
TYPE_ BOOK_ RESPONSE - The canonical
payload_typetag for [BookResponse]. - PAYLOAD_
TYPE_ CANCEL_ ALL_ ORDERS - The canonical
payload_typetag for [CancelAllOrders]. - PAYLOAD_
TYPE_ CANCEL_ ORDER - The canonical
payload_typetag for [CancelOrder]. - PAYLOAD_
TYPE_ CUSTOM_ DATA_ RESPONSE - The canonical
payload_typetag for [CustomDataResponse]. - PAYLOAD_
TYPE_ DEFI_ REQUEST_ COMMAND - The canonical
payload_typetag forDefiRequestCommand. - PAYLOAD_
TYPE_ DEFI_ SUBSCRIBE_ COMMAND - The canonical
payload_typetag forDefiSubscribeCommand. - PAYLOAD_
TYPE_ DEFI_ UNSUBSCRIBE_ COMMAND - The canonical
payload_typetag forDefiUnsubscribeCommand. - PAYLOAD_
TYPE_ EXECUTION_ MASS_ STATUS - The canonical
payload_typetag for [ExecutionMassStatus]. - PAYLOAD_
TYPE_ FILL_ REPORT - The canonical
payload_typetag for [FillReport]. - PAYLOAD_
TYPE_ FORWARD_ PRICES_ RESPONSE - The canonical
payload_typetag for [ForwardPricesResponse]. - PAYLOAD_
TYPE_ FUNDING_ RATES_ RESPONSE - The canonical
payload_typetag for [FundingRatesResponse]. - PAYLOAD_
TYPE_ INSTRUMENTS_ RESPONSE - The canonical
payload_typetag for [InstrumentsResponse]. - PAYLOAD_
TYPE_ INSTRUMENT_ RESPONSE - The canonical
payload_typetag for [InstrumentResponse]. - PAYLOAD_
TYPE_ MODIFY_ ORDER - The canonical
payload_typetag for [ModifyOrder]. - PAYLOAD_
TYPE_ ORDER_ ACCEPTED - The canonical
payload_typetag for [OrderAccepted]. - PAYLOAD_
TYPE_ ORDER_ CANCELED - The canonical
payload_typetag for [OrderCanceled]. - PAYLOAD_
TYPE_ ORDER_ CANCEL_ REJECTED - The canonical
payload_typetag for [OrderCancelRejected]. - PAYLOAD_
TYPE_ ORDER_ DENIED - The canonical
payload_typetag for [OrderDenied]. - PAYLOAD_
TYPE_ ORDER_ EMULATED - The canonical
payload_typetag for [OrderEmulated]. - PAYLOAD_
TYPE_ ORDER_ EXPIRED - The canonical
payload_typetag for [OrderExpired]. - PAYLOAD_
TYPE_ ORDER_ FILLED - The canonical
payload_typetag for [OrderFilled]. - PAYLOAD_
TYPE_ ORDER_ INITIALIZED - The canonical
payload_typetag for [OrderInitialized]. - PAYLOAD_
TYPE_ ORDER_ MODIFY_ REJECTED - The canonical
payload_typetag for [OrderModifyRejected]. - PAYLOAD_
TYPE_ ORDER_ PENDING_ CANCEL - The canonical
payload_typetag for [OrderPendingCancel]. - PAYLOAD_
TYPE_ ORDER_ PENDING_ UPDATE - The canonical
payload_typetag for [OrderPendingUpdate]. - PAYLOAD_
TYPE_ ORDER_ REJECTED - The canonical
payload_typetag for [OrderRejected]. - PAYLOAD_
TYPE_ ORDER_ RELEASED - The canonical
payload_typetag for [OrderReleased]. - PAYLOAD_
TYPE_ ORDER_ STATUS_ REPORT - The canonical
payload_typetag for [OrderStatusReport]. - PAYLOAD_
TYPE_ ORDER_ SUBMITTED - The canonical
payload_typetag for [OrderSubmitted]. - PAYLOAD_
TYPE_ ORDER_ TRIGGERED - The canonical
payload_typetag for [OrderTriggered]. - PAYLOAD_
TYPE_ ORDER_ UPDATED - The canonical
payload_typetag for [OrderUpdated]. - PAYLOAD_
TYPE_ ORDER_ WITH_ FILLS - The canonical
payload_typetag for the [ExecutionReport::OrderWithFills] bundle. - PAYLOAD_
TYPE_ POSITION_ ADJUSTED - The canonical
payload_typetag for [PositionAdjusted]. - PAYLOAD_
TYPE_ POSITION_ CHANGED - The canonical
payload_typetag for [PositionChanged]. - PAYLOAD_
TYPE_ POSITION_ CLOSED - The canonical
payload_typetag for [PositionClosed]. - PAYLOAD_
TYPE_ POSITION_ OPENED - The canonical
payload_typetag for [PositionOpened]. - PAYLOAD_
TYPE_ POSITION_ STATUS_ REPORT - The canonical
payload_typetag for [PositionStatusReport]. - PAYLOAD_
TYPE_ QUERY_ ACCOUNT - The canonical
payload_typetag for [QueryAccount]. - PAYLOAD_
TYPE_ QUERY_ ORDER - The canonical
payload_typetag for [QueryOrder]. - PAYLOAD_
TYPE_ QUOTES_ RESPONSE - The canonical
payload_typetag for [QuotesResponse]. - PAYLOAD_
TYPE_ REQUEST_ COMMAND - The canonical
payload_typetag forRequestCommand. - PAYLOAD_
TYPE_ SUBMIT_ ORDER - The canonical
payload_typetag for [SubmitOrder]. - PAYLOAD_
TYPE_ SUBMIT_ ORDER_ LIST - The canonical
payload_typetag for [SubmitOrderList]. - PAYLOAD_
TYPE_ SUBSCRIBE_ COMMAND - The canonical
payload_typetag forSubscribeCommand. - PAYLOAD_
TYPE_ TIME_ EVENT - The canonical
payload_typetag for [TimeEvent]. - PAYLOAD_
TYPE_ TRADES_ RESPONSE - The canonical
payload_typetag for [TradesResponse]. - PAYLOAD_
TYPE_ UNSUBSCRIBE_ COMMAND - The canonical
payload_typetag forUnsubscribeCommand.
Functions§
- default_
registry - Returns an
EncoderRegistrypreloaded with the default encoders. - encode_
account_ state - Encodes an [
AccountState] into canonical bytes with no sidecar indices. - encode_
data_ command - Encodes a [
DataCommand] envelope by dispatching on its command category. - encode_
data_ response - Encodes a [
DataResponse] envelope by dispatching on the variant. - encode_
execution_ report - Encodes an [
ExecutionReport] envelope by dispatching on the variant. - encode_
fill_ report - Encodes a [
FillReport] into canonical bytes plus itsvenue_order_idindex and, when present, itsclient_order_idindex. - encode_
order_ event_ any - Encodes an [
OrderEventAny] envelope by dispatching on the inner variant. - encode_
order_ filled - Encodes an [
OrderFilled] event into canonical bytes plus itsclient_order_idandvenue_order_idindices. - encode_
order_ status_ report - Encodes an [
OrderStatusReport] into canonical bytes plus itsvenue_order_idindex and, when present, itsclient_order_idindex. - encode_
position_ event - Encodes a [
PositionEvent] envelope by dispatching on the variant. - encode_
position_ status_ report - Encodes a [
PositionStatusReport] into canonical bytes with no sidecar indices. - encode_
submit_ order - Encodes a [
SubmitOrder] command into canonical bytes plus itsclient_order_idindex. - encode_
time_ event - Encodes a fired [
TimeEvent] into canonical bytes with no sidecar indices. - encode_
trading_ command - Encodes a [
TradingCommand] envelope by dispatching on the variant. - register_
default - Adds the default encoders to
registry.