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/).

Structs§

Advertisement
The Advertisement (35=7) message.
Allocation
The Allocation (35=J) message.
AllocationAllocs
An instance of the NoAllocs (78) group.
AllocationAllocsMiscFees
An instance of the NoMiscFees (136) group.
AllocationExecs
An instance of the NoExecs (124) group.
AllocationInstructionAck
The AllocationInstructionAck (35=P) message.
AllocationOrders
An instance of the NoOrders (73) group.
BidRequest
The BidRequest (35=k) message.
BidRequestBidComponents
An instance of the NoBidComponents (420) group.
BidRequestBidDescriptors
An instance of the NoBidDescriptors (398) group.
BidResponse
The BidResponse (35=l) message.
BidResponseBidComponents
An instance of the NoBidComponents (420) group.
BusinessMessageReject
The BusinessMessageReject (35=j) message.
DontKnowTrade
The DontKnowTrade (35=Q) message.
Email
The Email (35=C) message.
EmailLinesOfText
An instance of the LinesOfText (33) group.
EmailRelatedSym
An instance of the NoRelatedSym (146) group.
EmailRoutingIDs
An instance of the NoRoutingIDs (215) group.
ExecutionReport
The ExecutionReport (35=8) message.
ExecutionReportContraBrokers
An instance of the NoContraBrokers (382) group.
Header
The header fields of a message.
Heartbeat
The Heartbeat (35=0) message.
IOI
The IOI (35=6) message.
IOIIOIQualifiers
An instance of the NoIOIQualifiers (199) group.
IOIRoutingIDs
An instance of the NoRoutingIDs (215) group.
ListCancelRequest
The ListCancelRequest (35=K) message.
ListExecute
The ListExecute (35=L) message.
ListStatus
The ListStatus (35=N) message.
ListStatusOrders
An instance of the NoOrders (73) group.
ListStatusRequest
The ListStatusRequest (35=M) message.
ListStrikePrice
The ListStrikePrice (35=m) message.
ListStrikePriceStrikes
An instance of the NoStrikes (428) group.
Logon
The Logon (35=A) message.
LogonMsgTypes
An instance of the NoMsgTypes (384) group.
Logout
The Logout (35=5) message.
MarketDataIncrementalRefresh
The MarketDataIncrementalRefresh (35=X) message.
MarketDataIncrementalRefreshMDEntries
An instance of the NoMDEntries (268) group.
MarketDataRequest
The MarketDataRequest (35=V) message.
MarketDataRequestMDEntryTypes
An instance of the NoMDEntryTypes (267) group.
MarketDataRequestReject
The MarketDataRequestReject (35=Y) message.
MarketDataRequestRelatedSym
An instance of the NoRelatedSym (146) group.
MarketDataSnapshotFullRefresh
The MarketDataSnapshotFullRefresh (35=W) message.
MarketDataSnapshotFullRefreshMDEntries
An instance of the NoMDEntries (268) group.
MassQuote
The MassQuote (35=i) message.
MassQuoteQuoteSets
An instance of the NoQuoteSets (296) group.
MassQuoteQuoteSetsQuoteEntries
An instance of the NoQuoteEntries (295) group.
NewOrderList
The NewOrderList (35=E) message.
NewOrderListOrders
An instance of the NoOrders (73) group.
NewOrderListOrdersAllocs
An instance of the NoAllocs (78) group.
NewOrderListOrdersTradingSessions
An instance of the NoTradingSessions (386) group.
NewOrderSingle
The NewOrderSingle (35=D) message.
NewOrderSingleAllocs
An instance of the NoAllocs (78) group.
NewOrderSingleTradingSessions
An instance of the NoTradingSessions (386) group.
News
The News (35=B) message.
NewsLinesOfText
An instance of the LinesOfText (33) group.
NewsRelatedSym
An instance of the NoRelatedSym (146) group.
NewsRoutingIDs
An instance of the NoRoutingIDs (215) group.
OrderCancelReject
The OrderCancelReject (35=9) message.
OrderCancelReplaceRequest
The OrderCancelReplaceRequest (35=G) message.
OrderCancelReplaceRequestAllocs
An instance of the NoAllocs (78) group.
OrderCancelReplaceRequestTradingSessions
An instance of the NoTradingSessions (386) group.
OrderCancelRequest
The OrderCancelRequest (35=F) message.
OrderStatusRequest
The OrderStatusRequest (35=H) message.
Quote
The Quote (35=S) message.
QuoteAcknowledgement
The QuoteAcknowledgement (35=b) message.
QuoteAcknowledgementQuoteSets
An instance of the NoQuoteSets (296) group.
QuoteAcknowledgementQuoteSetsQuoteEntries
An instance of the NoQuoteEntries (295) group.
QuoteCancel
The QuoteCancel (35=Z) message.
QuoteCancelQuoteEntries
An instance of the NoQuoteEntries (295) group.
QuoteRequest
The QuoteRequest (35=R) message.
QuoteRequestRelatedSym
An instance of the NoRelatedSym (146) group.
QuoteStatusRequest
The QuoteStatusRequest (35=a) message.
Reject
The Reject (35=3) message.
ResendRequest
The ResendRequest (35=2) message.
SecurityDefinition
The SecurityDefinition (35=d) message.
SecurityDefinitionRelatedSym
An instance of the NoRelatedSym (146) group.
SecurityDefinitionRequest
The SecurityDefinitionRequest (35=c) message.
SecurityDefinitionRequestRelatedSym
An instance of the NoRelatedSym (146) group.
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.

Functions§

warm_up
Builds the tag lists that group reads share.