Skip to main content

Crate refix_fix42

Crate refix_fix42 

Source
Expand description

§refix-fix42

Typed FIX 4.2 messages for ReFIX, generated from QuickFIX’s FIX42.xml.

use bytes::Bytes;
use refix::message::{Decimal, TimePrecision, Tokenizer, UtcTimestamp};
use refix_fix42::{HandlInst, Message, OrdType, Side};

let frame = "8=FIX.4.2|9=123|35=D|49=SENDER|56=TARGET|34=1|52=20261008-09:30:00|\
             11=ORDER-1|21=1|55=ACME|54=1|60=20261008-09:30:00|40=2|44=101.25|38=100|10=142|";
let raw = Tokenizer::default()
    .tokenize(Bytes::from(frame.replace('|', "\x01")))
    .unwrap();
let Message::NewOrderSingle(order) = Message::from_raw(raw) else {
    panic!("expected a NewOrderSingle");
};

assert_eq!(order.header().sender_comp_id(), Ok(Some("SENDER")));
assert_eq!(order.header().msg_seq_num(), Ok(Some(1)));
assert_eq!(order.cl_ord_id(), Ok(Some("ORDER-1")));
assert_eq!(
    order.handl_inst(),
    Ok(Some(HandlInst::AutomatedExecutionNoIntervention))
);
assert_eq!(order.symbol(), Ok(Some("ACME")));
assert_eq!(order.side(), Ok(Some(Side::Buy)));
assert_eq!(order.ord_type(), Ok(Some(OrdType::Limit)));
assert_eq!(order.price(), Ok(Some(Decimal::new(10125, -2))));
assert_eq!(
    order.transact_time(),
    Ok(Some(UtcTimestamp::new(1_791_451_800_000_000_000, TimePrecision::SECONDS)))
);

Message::from_raw reads each message as the type its MsgType names, and any other as Message::Unrecognized.

§License

Licensed under either of

  • Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)

at your option.

The code is generated from QuickFIX’s FIX42.xml, under the QuickFIX Software License (LICENSE-QUICKFIX). This product includes software developed by quickfixengine.org (http://www.quickfixengine.org/).

Modules§

allocation
bid_request
bid_response
email
execution_report
ioi
list_status
list_strike_price
logon
market_data_incremental_refresh
market_data_request
market_data_snapshot_full_refresh
mass_quote
new_order_list
new_order_single
news
order_cancel_replace_request
quote_acknowledgement
quote_cancel
quote_request
security_definition
security_definition_request

Structs§

Advertisement
The Advertisement (35=7) message.
Allocation
The Allocation (35=J) message.
AllocationInstructionAck
The AllocationInstructionAck (35=P) message.
BidRequest
The BidRequest (35=k) message.
BidResponse
The BidResponse (35=l) message.
BusinessMessageReject
The BusinessMessageReject (35=j) message.
DontKnowTrade
The DontKnowTrade (35=Q) message.
Email
The Email (35=C) message.
ExecutionReport
The ExecutionReport (35=8) message.
Header
The header fields of a message.
Heartbeat
The Heartbeat (35=0) message.
IOI
The IOI (35=6) message.
ListCancelRequest
The ListCancelRequest (35=K) message.
ListExecute
The ListExecute (35=L) message.
ListStatus
The ListStatus (35=N) message.
ListStatusRequest
The ListStatusRequest (35=M) message.
ListStrikePrice
The ListStrikePrice (35=m) message.
Logon
The Logon (35=A) message.
Logout
The Logout (35=5) message.
MarketDataIncrementalRefresh
The MarketDataIncrementalRefresh (35=X) message.
MarketDataRequest
The MarketDataRequest (35=V) message.
MarketDataRequestReject
The MarketDataRequestReject (35=Y) message.
MarketDataSnapshotFullRefresh
The MarketDataSnapshotFullRefresh (35=W) message.
MassQuote
The MassQuote (35=i) message.
NewOrderList
The NewOrderList (35=E) message.
NewOrderSingle
The NewOrderSingle (35=D) message.
News
The News (35=B) message.
OrderCancelReject
The OrderCancelReject (35=9) message.
OrderCancelReplaceRequest
The OrderCancelReplaceRequest (35=G) message.
OrderCancelRequest
The OrderCancelRequest (35=F) message.
OrderStatusRequest
The OrderStatusRequest (35=H) message.
Quote
The Quote (35=S) message.
QuoteAcknowledgement
The QuoteAcknowledgement (35=b) message.
QuoteCancel
The QuoteCancel (35=Z) message.
QuoteRequest
The QuoteRequest (35=R) message.
QuoteStatusRequest
The QuoteStatusRequest (35=a) message.
Reject
The Reject (35=3) message.
ResendRequest
The ResendRequest (35=2) message.
SecurityDefinition
The SecurityDefinition (35=d) message.
SecurityDefinitionRequest
The SecurityDefinitionRequest (35=c) message.
SecurityStatus
The SecurityStatus (35=f) message.
SecurityStatusRequest
The SecurityStatusRequest (35=e) message.
SequenceReset
The SequenceReset (35=4) message.
SettlementInstructions
The SettlementInstructions (35=T) message.
TestRequest
The TestRequest (35=1) message.
TradingSessionStatus
The TradingSessionStatus (35=h) message.
TradingSessionStatusRequest
The TradingSessionStatusRequest (35=g) message.
Trailer
The trailer fields of a message.

Enums§

Adjustment
The values of the Adjustment (334) field.
AdvSide
The values of the AdvSide (4) field.
AdvTransType
The values of the AdvTransType (5) field.
AllocHandlInst
The values of the AllocHandlInst (209) field.
AllocLinkType
The values of the AllocLinkType (197) field.
AllocRejCode
The values of the AllocRejCode (88) field.
AllocStatus
The values of the AllocStatus (87) field.
AllocTransType
The values of the AllocTransType (71) field.
BasisPxType
The values of the BasisPxType (419) field.
Benchmark
The values of the Benchmark (219) field.
BidRequestTransType
The values of the BidRequestTransType (374) field.
BusinessRejectReason
The values of the BusinessRejectReason (380) field.
CommType
The values of the CommType (13) field.
CorporateAction
The values of the CorporateAction (292) field.
CoveredOrUncovered
The values of the CoveredOrUncovered (203) field.
CustomerOrFirm
The values of the CustomerOrFirm (204) field.
CxlRejReason
The values of the CxlRejReason (102) field.
CxlRejResponseTo
The values of the CxlRejResponseTo (434) field.
DKReason
The values of the DKReason (127) field.
DeleteReason
The values of the DeleteReason (285) field.
DiscretionInst
The values of the DiscretionInst (388) field.
EmailType
The values of the EmailType (94) field.
EncryptMethod
The values of the EncryptMethod (98) field.
ExecInst
The values of the ExecInst (18) field.
ExecRestatementReason
The values of the ExecRestatementReason (378) field.
ExecTransType
The values of the ExecTransType (20) field.
ExecType
The values of the ExecType (150) field.
FinancialStatus
The values of the FinancialStatus (291) field.
GTBookingInst
The values of the GTBookingInst (427) field.
HaltReasonChar
The values of the HaltReasonChar (327) field.
HandlInst
The values of the HandlInst (21) field.
IDSource
The values of the IDSource (22) field.
IOIQltyInd
The values of the IOIQltyInd (25) field.
IOIQualifier
The values of the IOIQualifier (104) field.
IOIShares
The values of the IOIShares (27) field.
IOITransType
The values of the IOITransType (28) field.
IncTaxInd
The values of the IncTaxInd (416) field.
LastCapacity
The values of the LastCapacity (29) field.
LiquidityIndType
The values of the LiquidityIndType (409) field.
ListExecInstType
The values of the ListExecInstType (433) field.
MDEntryType
The values of the MDEntryType (269) field.
MDReqRejReason
The values of the MDReqRejReason (281) field.
MDUpdateAction
The values of the MDUpdateAction (279) field.
MDUpdateType
The values of the MDUpdateType (265) field.
Message
A message read as the type its MsgType names.
MessageEncoding
The values of the MessageEncoding (347) field.
MiscFeeType
The values of the MiscFeeType (139) field.
MsgDirection
The values of the MsgDirection (385) field.
MsgType
The values of the MsgType (35) field.
MultiLegReportingType
The values of the MultiLegReportingType (442) field.
NetGrossInd
The values of the NetGrossInd (430) field.
OpenClose
The values of the OpenClose (77) field.
OpenCloseSettleFlag
The values of the OpenCloseSettleFlag (286) field.
OrdRejReason
The values of the OrdRejReason (103) field.
OrdStatus
The values of the OrdStatus (39) field.
OrdType
The values of the OrdType (40) field.
PriceType
The values of the PriceType (423) field.
ProcessCode
The values of the ProcessCode (81) field.
ProgRptReqs
The values of the ProgRptReqs (414) field.
PutOrCall
The values of the PutOrCall (201) field.
QuoteCancelType
The values of the QuoteCancelType (298) field.
QuoteCondition
The values of the QuoteCondition (276) field.
QuoteEntryRejectReason
The values of the QuoteEntryRejectReason (368) field.
QuoteRejectReason
The values of the QuoteRejectReason (300) field.
QuoteRequestType
The values of the QuoteRequestType (303) field.
QuoteResponseLevel
The values of the QuoteResponseLevel (301) field.
QuoteStatus
The values of the QuoteStatus (297) field.
RoutingType
The values of the RoutingType (216) field.
Rule80A
The values of the Rule80A (47) field.
SecurityRequestType
The values of the SecurityRequestType (321) field.
SecurityResponseType
The values of the SecurityResponseType (323) field.
SecurityTradingStatus
The values of the SecurityTradingStatus (326) field.
SecurityType
The values of the SecurityType (167) field.
SessionRejectReason
The values of the SessionRejectReason (373) field.
SettlInstMode
The values of the SettlInstMode (160) field.
SettlInstSource
The values of the SettlInstSource (165) field.
SettlInstTransType
The values of the SettlInstTransType (163) field.
SettlLocation
The values of the SettlLocation (166) field.
SettlmntTyp
The values of the SettlmntTyp (63) field.
Side
The values of the Side (54) field.
StandInstDbType
The values of the StandInstDbType (169) field.
SubscriptionRequestType
The values of the SubscriptionRequestType (263) field.
TickDirection
The values of the TickDirection (274) field.
TimeInForce
The values of the TimeInForce (59) field.
TradSesMethod
The values of the TradSesMethod (338) field.
TradSesMode
The values of the TradSesMode (339) field.
TradSesStatus
The values of the TradSesStatus (340) field.
TradeCondition
The values of the TradeCondition (277) field.
TradeType
The values of the TradeType (418) field.
Urgency
The values of the Urgency (61) field.

Constants§

DIALECT
The dialect of this dictionary.