refix-fix42 0.4.0

Typed FIX 4.2 protocol messages for the ReFIX engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
// @generated by refix codegen from FIX42.xml. Do not edit.
#![cfg_attr(rustfmt, rustfmt::skip)]

use refix_message::{
    Date, Decimal, GroupTable, Instances, InvalidValue, LazyKnownTags, MonthYear, MultipleValues,
    RawMessage, Tag, Time, UtcTimestamp,
};

use super::super::components::{Header, Trailer};
use super::super::enums::{
    CorporateAction, DeleteReason, ExecInst, FinancialStatus, IDSource, MDEntryType, MDUpdateAction,
    OpenCloseSettleFlag, PutOrCall, QuoteCondition, SecurityType, TickDirection, TimeInForce,
    TradeCondition,
};

/// The `MarketDataIncrementalRefresh` (35=X) message.
pub struct MarketDataIncrementalRefresh(RawMessage);

impl MarketDataIncrementalRefresh {
    pub const MSG_TYPE: &[u8] = b"X";

    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
        static TAGS: LazyKnownTags = LazyKnownTags::new(
            &[Tag(262), Tag(268)],
            &[
                Header::known_tags(), Trailer::known_tags(),
                MarketDataIncrementalRefreshMDEntries::known_tags(),
            ],
        );
        &TAGS
    }

    pub fn from_raw(raw: RawMessage) -> Self {
        Self(raw)
    }

    pub fn raw(&self) -> &RawMessage {
        &self.0
    }

    pub fn header(&self) -> Header<'_> {
        Header(self.0.scope())
    }

    pub fn trailer(&self) -> Trailer<'_> {
        Trailer(self.0.scope())
    }

    /// The `MDReqID` (262) field.
    #[doc(alias = "MDReqID")]
    pub fn md_req_id(&self) -> Result<Option<&str>, InvalidValue> {
        self.0.get_str(Tag(262))
    }

    /// The instances of the `NoMDEntries` (268) group.
    #[doc(alias = "NoMDEntries")]
    pub fn md_entries(&self) -> Result<Instances<'_, MarketDataIncrementalRefreshMDEntries<'_>>, InvalidValue> {
        self.0.get_group(&MarketDataIncrementalRefreshMDEntries::TABLE, &Self::known_tags().get()).map(Instances::from)
    }
}

impl std::fmt::Debug for MarketDataIncrementalRefresh {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "MarketDataIncrementalRefresh({})", self.0)
    }
}

impl std::fmt::Display for MarketDataIncrementalRefresh {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        std::fmt::Display::fmt(&self.0, f)
    }
}

/// An instance of the `NoMDEntries` (268) group.
#[derive(Clone, Copy)]
pub struct MarketDataIncrementalRefreshMDEntries<'a>(refix_message::Scope<'a>);

impl<'a> From<refix_message::Scope<'a>> for MarketDataIncrementalRefreshMDEntries<'a> {
    fn from(scope: refix_message::Scope<'a>) -> Self {
        Self(scope)
    }
}

impl<'a> MarketDataIncrementalRefreshMDEntries<'a> {
    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
        Tag(268),
        Tag(279),
        &[
            Tag(15), Tag(18), Tag(22), Tag(37), Tag(48), Tag(55), Tag(58), Tag(59), Tag(65),
            Tag(106), Tag(107), Tag(110), Tag(126), Tag(167), Tag(200), Tag(201), Tag(202),
            Tag(205), Tag(206), Tag(207), Tag(223), Tag(231), Tag(269), Tag(270), Tag(271),
            Tag(272), Tag(273), Tag(274), Tag(275), Tag(276), Tag(277), Tag(278), Tag(279),
            Tag(280), Tag(282), Tag(283), Tag(284), Tag(285), Tag(286), Tag(287), Tag(288),
            Tag(289), Tag(290), Tag(291), Tag(292), Tag(299), Tag(336), Tag(346), Tag(348),
            Tag(349), Tag(350), Tag(351), Tag(354), Tag(355), Tag(387), Tag(432),
        ],
        &[],
    );

    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
        static TAGS: LazyKnownTags = LazyKnownTags::new(
            &[
                Tag(279), Tag(285), Tag(269), Tag(278), Tag(280), Tag(55), Tag(65), Tag(48),
                Tag(22), Tag(167), Tag(200), Tag(205), Tag(201), Tag(202), Tag(206), Tag(231),
                Tag(223), Tag(207), Tag(106), Tag(348), Tag(349), Tag(107), Tag(350), Tag(351),
                Tag(291), Tag(292), Tag(270), Tag(15), Tag(271), Tag(272), Tag(273), Tag(274),
                Tag(275), Tag(336), Tag(276), Tag(277), Tag(282), Tag(283), Tag(284), Tag(286),
                Tag(59), Tag(432), Tag(126), Tag(110), Tag(18), Tag(287), Tag(37), Tag(299),
                Tag(288), Tag(289), Tag(346), Tag(290), Tag(387), Tag(58), Tag(354), Tag(355),
            ],
            &[],
        );
        &TAGS
    }

    pub fn raw(&self) -> refix_message::Scope<'a> {
        self.0
    }

    /// The `MDUpdateAction` (279) field.
    #[doc(alias = "MDUpdateAction")]
    pub fn md_update_action(&self) -> Result<Option<MDUpdateAction<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(279))?.map(MDUpdateAction::from_value))
    }

    /// The `DeleteReason` (285) field.
    #[doc(alias = "DeleteReason")]
    pub fn delete_reason(&self) -> Result<Option<DeleteReason<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(285))?.map(DeleteReason::from_value))
    }

    /// The `MDEntryType` (269) field.
    #[doc(alias = "MDEntryType")]
    pub fn md_entry_type(&self) -> Result<Option<MDEntryType<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(269))?.map(MDEntryType::from_value))
    }

    /// The `MDEntryID` (278) field.
    #[doc(alias = "MDEntryID")]
    pub fn md_entry_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(278))
    }

    /// The `MDEntryRefID` (280) field.
    #[doc(alias = "MDEntryRefID")]
    pub fn md_entry_ref_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(280))
    }

    /// The `Symbol` (55) field.
    #[doc(alias = "Symbol")]
    pub fn symbol(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(55))
    }

    /// The `SymbolSfx` (65) field.
    #[doc(alias = "SymbolSfx")]
    pub fn symbol_sfx(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(65))
    }

    /// The `SecurityID` (48) field.
    #[doc(alias = "SecurityID")]
    pub fn security_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(48))
    }

    /// The `IDSource` (22) field.
    #[doc(alias = "IDSource")]
    pub fn id_source(&self) -> Result<Option<IDSource<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(22))?.map(IDSource::from_value))
    }

    /// The `SecurityType` (167) field.
    #[doc(alias = "SecurityType")]
    pub fn security_type(&self) -> Result<Option<SecurityType<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(167))?.map(SecurityType::from_value))
    }

    /// The `MaturityMonthYear` (200) field.
    #[doc(alias = "MaturityMonthYear")]
    pub fn maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
        self.0.get_month_year(Tag(200))
    }

    /// The `MaturityDay` (205) field.
    #[doc(alias = "MaturityDay")]
    pub fn maturity_day(&self) -> Result<Option<i64>, InvalidValue> {
        self.0.get_int(Tag(205))
    }

    /// The `PutOrCall` (201) field.
    #[doc(alias = "PutOrCall")]
    pub fn put_or_call(&self) -> Result<Option<PutOrCall>, InvalidValue> {
        Ok(self.0.get_int(Tag(201))?.map(PutOrCall::from_value))
    }

    /// The `StrikePrice` (202) field.
    #[doc(alias = "StrikePrice")]
    pub fn strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(202))
    }

    /// The `OptAttribute` (206) field.
    #[doc(alias = "OptAttribute")]
    pub fn opt_attribute(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(206))
    }

    /// The `ContractMultiplier` (231) field.
    #[doc(alias = "ContractMultiplier")]
    pub fn contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(231))
    }

    /// The `CouponRate` (223) field.
    #[doc(alias = "CouponRate")]
    pub fn coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(223))
    }

    /// The `SecurityExchange` (207) field.
    #[doc(alias = "SecurityExchange")]
    pub fn security_exchange(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(207))
    }

    /// The `Issuer` (106) field.
    #[doc(alias = "Issuer")]
    pub fn issuer(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(106))
    }

    /// The `EncodedIssuerLen` (348) field.
    #[doc(alias = "EncodedIssuerLen")]
    pub fn encoded_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
        self.0.get_int(Tag(348))
    }

    /// The `EncodedIssuer` (349) field.
    #[doc(alias = "EncodedIssuer")]
    pub fn encoded_issuer(&self) -> Option<&'a [u8]> {
        self.0.get(Tag(349))
    }

    /// The `SecurityDesc` (107) field.
    #[doc(alias = "SecurityDesc")]
    pub fn security_desc(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(107))
    }

    /// The `EncodedSecurityDescLen` (350) field.
    #[doc(alias = "EncodedSecurityDescLen")]
    pub fn encoded_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
        self.0.get_int(Tag(350))
    }

    /// The `EncodedSecurityDesc` (351) field.
    #[doc(alias = "EncodedSecurityDesc")]
    pub fn encoded_security_desc(&self) -> Option<&'a [u8]> {
        self.0.get(Tag(351))
    }

    /// The `FinancialStatus` (291) field.
    #[doc(alias = "FinancialStatus")]
    pub fn financial_status(&self) -> Result<Option<FinancialStatus<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(291))?.map(FinancialStatus::from_value))
    }

    /// The `CorporateAction` (292) field.
    #[doc(alias = "CorporateAction")]
    pub fn corporate_action(&self) -> Result<Option<CorporateAction<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(292))?.map(CorporateAction::from_value))
    }

    /// The `MDEntryPx` (270) field.
    #[doc(alias = "MDEntryPx")]
    pub fn md_entry_px(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(270))
    }

    /// The `Currency` (15) field.
    #[doc(alias = "Currency")]
    pub fn currency(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(15))
    }

    /// The `MDEntrySize` (271) field.
    #[doc(alias = "MDEntrySize")]
    pub fn md_entry_size(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(271))
    }

    /// The `MDEntryDate` (272) field.
    #[doc(alias = "MDEntryDate")]
    pub fn md_entry_date(&self) -> Result<Option<Date>, InvalidValue> {
        self.0.get_date(Tag(272))
    }

    /// The `MDEntryTime` (273) field.
    #[doc(alias = "MDEntryTime")]
    pub fn md_entry_time(&self) -> Result<Option<Time>, InvalidValue> {
        self.0.get_time(Tag(273))
    }

    /// The `TickDirection` (274) field.
    #[doc(alias = "TickDirection")]
    pub fn tick_direction(&self) -> Result<Option<TickDirection<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(274))?.map(TickDirection::from_value))
    }

    /// The `MDMkt` (275) field.
    #[doc(alias = "MDMkt")]
    pub fn md_mkt(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(275))
    }

    /// The `TradingSessionID` (336) field.
    #[doc(alias = "TradingSessionID")]
    pub fn trading_session_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(336))
    }

    /// The `QuoteCondition` (276) field.
    #[doc(alias = "QuoteCondition")]
    pub fn quote_condition(&self) -> Result<Option<MultipleValues<'a, QuoteCondition<'a>>>, InvalidValue> {
        self.0.get_multiple_values(Tag(276))
    }

    /// The `TradeCondition` (277) field.
    #[doc(alias = "TradeCondition")]
    pub fn trade_condition(&self) -> Result<Option<MultipleValues<'a, TradeCondition<'a>>>, InvalidValue> {
        self.0.get_multiple_values(Tag(277))
    }

    /// The `MDEntryOriginator` (282) field.
    #[doc(alias = "MDEntryOriginator")]
    pub fn md_entry_originator(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(282))
    }

    /// The `LocationID` (283) field.
    #[doc(alias = "LocationID")]
    pub fn location_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(283))
    }

    /// The `DeskID` (284) field.
    #[doc(alias = "DeskID")]
    pub fn desk_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(284))
    }

    /// The `OpenCloseSettleFlag` (286) field.
    #[doc(alias = "OpenCloseSettleFlag")]
    pub fn open_close_settle_flag(&self) -> Result<Option<OpenCloseSettleFlag<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(286))?.map(OpenCloseSettleFlag::from_value))
    }

    /// The `TimeInForce` (59) field.
    #[doc(alias = "TimeInForce")]
    pub fn time_in_force(&self) -> Result<Option<TimeInForce<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(59))?.map(TimeInForce::from_value))
    }

    /// The `ExpireDate` (432) field.
    #[doc(alias = "ExpireDate")]
    pub fn expire_date(&self) -> Result<Option<Date>, InvalidValue> {
        self.0.get_date(Tag(432))
    }

    /// The `ExpireTime` (126) field.
    #[doc(alias = "ExpireTime")]
    pub fn expire_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
        self.0.get_utc_timestamp(Tag(126))
    }

    /// The `MinQty` (110) field.
    #[doc(alias = "MinQty")]
    pub fn min_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(110))
    }

    /// The `ExecInst` (18) field.
    #[doc(alias = "ExecInst")]
    pub fn exec_inst(&self) -> Result<Option<MultipleValues<'a, ExecInst<'a>>>, InvalidValue> {
        self.0.get_multiple_values(Tag(18))
    }

    /// The `SellerDays` (287) field.
    #[doc(alias = "SellerDays")]
    pub fn seller_days(&self) -> Result<Option<i64>, InvalidValue> {
        self.0.get_int(Tag(287))
    }

    /// The `OrderID` (37) field.
    #[doc(alias = "OrderID")]
    pub fn order_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(37))
    }

    /// The `QuoteEntryID` (299) field.
    #[doc(alias = "QuoteEntryID")]
    pub fn quote_entry_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(299))
    }

    /// The `MDEntryBuyer` (288) field.
    #[doc(alias = "MDEntryBuyer")]
    pub fn md_entry_buyer(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(288))
    }

    /// The `MDEntrySeller` (289) field.
    #[doc(alias = "MDEntrySeller")]
    pub fn md_entry_seller(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(289))
    }

    /// The `NumberOfOrders` (346) field.
    #[doc(alias = "NumberOfOrders")]
    pub fn number_of_orders(&self) -> Result<Option<i64>, InvalidValue> {
        self.0.get_int(Tag(346))
    }

    /// The `MDEntryPositionNo` (290) field.
    #[doc(alias = "MDEntryPositionNo")]
    pub fn md_entry_position_no(&self) -> Result<Option<i64>, InvalidValue> {
        self.0.get_int(Tag(290))
    }

    /// The `TotalVolumeTraded` (387) field.
    #[doc(alias = "TotalVolumeTraded")]
    pub fn total_volume_traded(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(387))
    }

    /// The `Text` (58) field.
    #[doc(alias = "Text")]
    pub fn text(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(58))
    }

    /// The `EncodedTextLen` (354) field.
    #[doc(alias = "EncodedTextLen")]
    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
        self.0.get_int(Tag(354))
    }

    /// The `EncodedText` (355) field.
    #[doc(alias = "EncodedText")]
    pub fn encoded_text(&self) -> Option<&'a [u8]> {
        self.0.get(Tag(355))
    }
}

impl std::fmt::Debug for MarketDataIncrementalRefreshMDEntries<'_> {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "MarketDataIncrementalRefreshMDEntries({})", self.0)
    }
}