Skip to main content

Module builtins

Module builtins 

Source
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_type tag for [AccountState].
PAYLOAD_TYPE_BARS_RESPONSE
The canonical payload_type tag for [BarsResponse].
PAYLOAD_TYPE_BATCH_CANCEL_ORDERS
The canonical payload_type tag for [BatchCancelOrders].
PAYLOAD_TYPE_BATCH_MODIFY_ORDERS
The canonical payload_type tag for [BatchModifyOrders].
PAYLOAD_TYPE_BOOK_DELTAS_RESPONSE
The canonical payload_type tag for [BookDeltasResponse].
PAYLOAD_TYPE_BOOK_DEPTH_RESPONSE
The canonical payload_type tag for [BookDepthResponse].
PAYLOAD_TYPE_BOOK_RESPONSE
The canonical payload_type tag for [BookResponse].
PAYLOAD_TYPE_CANCEL_ALL_ORDERS
The canonical payload_type tag for [CancelAllOrders].
PAYLOAD_TYPE_CANCEL_ORDER
The canonical payload_type tag for [CancelOrder].
PAYLOAD_TYPE_CUSTOM_DATA_RESPONSE
The canonical payload_type tag for [CustomDataResponse].
PAYLOAD_TYPE_DEFI_REQUEST_COMMAND
The canonical payload_type tag for DefiRequestCommand.
PAYLOAD_TYPE_DEFI_SUBSCRIBE_COMMAND
The canonical payload_type tag for DefiSubscribeCommand.
PAYLOAD_TYPE_DEFI_UNSUBSCRIBE_COMMAND
The canonical payload_type tag for DefiUnsubscribeCommand.
PAYLOAD_TYPE_EXECUTION_MASS_STATUS
The canonical payload_type tag for [ExecutionMassStatus].
PAYLOAD_TYPE_FILL_REPORT
The canonical payload_type tag for [FillReport].
PAYLOAD_TYPE_FORWARD_PRICES_RESPONSE
The canonical payload_type tag for [ForwardPricesResponse].
PAYLOAD_TYPE_FUNDING_RATES_RESPONSE
The canonical payload_type tag for [FundingRatesResponse].
PAYLOAD_TYPE_INSTRUMENTS_RESPONSE
The canonical payload_type tag for [InstrumentsResponse].
PAYLOAD_TYPE_INSTRUMENT_RESPONSE
The canonical payload_type tag for [InstrumentResponse].
PAYLOAD_TYPE_MODIFY_ORDER
The canonical payload_type tag for [ModifyOrder].
PAYLOAD_TYPE_ORDER_ACCEPTED
The canonical payload_type tag for [OrderAccepted].
PAYLOAD_TYPE_ORDER_CANCELED
The canonical payload_type tag for [OrderCanceled].
PAYLOAD_TYPE_ORDER_CANCEL_REJECTED
The canonical payload_type tag for [OrderCancelRejected].
PAYLOAD_TYPE_ORDER_DENIED
The canonical payload_type tag for [OrderDenied].
PAYLOAD_TYPE_ORDER_EMULATED
The canonical payload_type tag for [OrderEmulated].
PAYLOAD_TYPE_ORDER_EXPIRED
The canonical payload_type tag for [OrderExpired].
PAYLOAD_TYPE_ORDER_FILLED
The canonical payload_type tag for [OrderFilled].
PAYLOAD_TYPE_ORDER_INITIALIZED
The canonical payload_type tag for [OrderInitialized].
PAYLOAD_TYPE_ORDER_MODIFY_REJECTED
The canonical payload_type tag for [OrderModifyRejected].
PAYLOAD_TYPE_ORDER_PENDING_CANCEL
The canonical payload_type tag for [OrderPendingCancel].
PAYLOAD_TYPE_ORDER_PENDING_UPDATE
The canonical payload_type tag for [OrderPendingUpdate].
PAYLOAD_TYPE_ORDER_REJECTED
The canonical payload_type tag for [OrderRejected].
PAYLOAD_TYPE_ORDER_RELEASED
The canonical payload_type tag for [OrderReleased].
PAYLOAD_TYPE_ORDER_STATUS_REPORT
The canonical payload_type tag for [OrderStatusReport].
PAYLOAD_TYPE_ORDER_SUBMITTED
The canonical payload_type tag for [OrderSubmitted].
PAYLOAD_TYPE_ORDER_TRIGGERED
The canonical payload_type tag for [OrderTriggered].
PAYLOAD_TYPE_ORDER_UPDATED
The canonical payload_type tag for [OrderUpdated].
PAYLOAD_TYPE_ORDER_WITH_FILLS
The canonical payload_type tag for the [ExecutionReport::OrderWithFills] bundle.
PAYLOAD_TYPE_POSITION_ADJUSTED
The canonical payload_type tag for [PositionAdjusted].
PAYLOAD_TYPE_POSITION_CHANGED
The canonical payload_type tag for [PositionChanged].
PAYLOAD_TYPE_POSITION_CLOSED
The canonical payload_type tag for [PositionClosed].
PAYLOAD_TYPE_POSITION_OPENED
The canonical payload_type tag for [PositionOpened].
PAYLOAD_TYPE_POSITION_STATUS_REPORT
The canonical payload_type tag for [PositionStatusReport].
PAYLOAD_TYPE_QUERY_ACCOUNT
The canonical payload_type tag for [QueryAccount].
PAYLOAD_TYPE_QUERY_ORDER
The canonical payload_type tag for [QueryOrder].
PAYLOAD_TYPE_QUOTES_RESPONSE
The canonical payload_type tag for [QuotesResponse].
PAYLOAD_TYPE_REQUEST_COMMAND
The canonical payload_type tag for RequestCommand.
PAYLOAD_TYPE_SUBMIT_ORDER
The canonical payload_type tag for [SubmitOrder].
PAYLOAD_TYPE_SUBMIT_ORDER_LIST
The canonical payload_type tag for [SubmitOrderList].
PAYLOAD_TYPE_SUBSCRIBE_COMMAND
The canonical payload_type tag for SubscribeCommand.
PAYLOAD_TYPE_TIME_EVENT
The canonical payload_type tag for [TimeEvent].
PAYLOAD_TYPE_TRADES_RESPONSE
The canonical payload_type tag for [TradesResponse].
PAYLOAD_TYPE_UNSUBSCRIBE_COMMAND
The canonical payload_type tag for UnsubscribeCommand.

Functions§

default_registry
Returns an EncoderRegistry preloaded 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 its venue_order_id index and, when present, its client_order_id index.
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 its client_order_id and venue_order_id indices.
encode_order_status_report
Encodes an [OrderStatusReport] into canonical bytes plus its venue_order_id index and, when present, its client_order_id index.
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 its client_order_id index.
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.