Skip to main content

fixer_fix/fix41/
execution_report.rs

1// Code generated by fixer-gen. DO NOT EDIT.
2#![allow(clippy::new_without_default)]
3#![allow(clippy::needless_pass_by_value)]
4#![allow(clippy::too_many_arguments)]
5#![allow(unused_imports)]
6
7use fixer::message::Message;
8use fixer::fix_string::FIXString;
9use fixer::errors::MessageRejectErrorEnum;
10use fixer::session::session_id::SessionID;
11
12use rust_decimal::Decimal;
13
14
15use jiff::Timestamp;
16
17use crate::field;
18use crate::tag;
19
20/// `ExecutionReport` is the `fix41` `ExecutionReport` type, `MsgType` = 8.
21pub struct ExecutionReport {
22    pub message: Message,
23}
24
25impl ExecutionReport {
26    /// Creates a new `ExecutionReport` with required fields.
27    pub fn new(order_id: field::OrderIDField, exec_id: field::ExecIDField, exec_trans_type: field::ExecTransTypeField, exec_type: field::ExecTypeField, ord_status: field::OrdStatusField, symbol: field::SymbolField, side: field::SideField, order_qty: field::OrderQtyField, last_shares: field::LastSharesField, last_px: field::LastPxField, leaves_qty: field::LeavesQtyField, cum_qty: field::CumQtyField, avg_px: field::AvgPxField) -> Self {
28        let mut msg = Message::new();
29        msg.header.set_field(tag::MSG_TYPE, FIXString::from("8".to_string()));
30
31        msg.body.set_field(tag::ORDER_ID, order_id.0);
32
33        msg.body.set_field(tag::EXEC_ID, exec_id.0);
34
35        msg.body.set_field(tag::EXEC_TRANS_TYPE, exec_trans_type.0);
36
37        msg.body.set_field(tag::EXEC_TYPE, exec_type.0);
38
39        msg.body.set_field(tag::ORD_STATUS, ord_status.0);
40
41        msg.body.set_field(tag::SYMBOL, symbol.0);
42
43        msg.body.set_field(tag::SIDE, side.0);
44
45        msg.body.set_field(tag::ORDER_QTY, order_qty.0);
46
47        msg.body.set_field(tag::LAST_SHARES, last_shares.0);
48
49        msg.body.set_field(tag::LAST_PX, last_px.0);
50
51        msg.body.set_field(tag::LEAVES_QTY, leaves_qty.0);
52
53        msg.body.set_field(tag::CUM_QTY, cum_qty.0);
54
55        msg.body.set_field(tag::AVG_PX, avg_px.0);
56
57        Self { message: msg }
58    }
59
60    /// Creates a `ExecutionReport` from an existing `Message`.
61    pub fn from_message(msg: Message) -> Self {
62        Self { message: msg }
63    }
64
65    /// Returns the underlying `Message`.
66    pub fn to_message(self) -> Message {
67        self.message
68    }
69
70
71
72
73    /// Sets `Account`, Tag 1.
74    pub fn set_account(&mut self, v: String) {
75        self.message.body.set_field(tag::ACCOUNT, FIXString::from(v));
76    }
77
78    /// Gets `Account`, Tag 1.
79    pub fn get_account(&self) -> Result<String, MessageRejectErrorEnum> {
80        let mut fld = field::AccountField::new(String::new());
81        self.message.body.get_field(tag::ACCOUNT, &mut fld.0)?;
82        Ok(fld.value().to_string())
83    }
84
85
86    /// Returns true if `Account` is present, Tag 1.
87    pub fn has_account(&self) -> bool {
88        self.message.body.has(tag::ACCOUNT)
89    }
90
91
92
93
94    /// Sets `AvgPx`, Tag 6.
95    pub fn set_avg_px(&mut self, val: Decimal, scale: i32) {
96        self.message.body.set_field(tag::AVG_PX, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
97    }
98
99    /// Gets `AvgPx`, Tag 6.
100    pub fn get_avg_px(&self) -> Result<Decimal, MessageRejectErrorEnum> {
101        let mut fld = field::AvgPxField::new(Decimal::ZERO, 0);
102        self.message.body.get_field(tag::AVG_PX, &mut fld.0)?;
103        Ok(fld.value())
104    }
105
106
107    /// Returns true if `AvgPx` is present, Tag 6.
108    pub fn has_avg_px(&self) -> bool {
109        self.message.body.has(tag::AVG_PX)
110    }
111
112
113
114
115    /// Sets `ClOrdID`, Tag 11.
116    pub fn set_cl_ord_id(&mut self, v: String) {
117        self.message.body.set_field(tag::CL_ORD_ID, FIXString::from(v));
118    }
119
120    /// Gets `ClOrdID`, Tag 11.
121    pub fn get_cl_ord_id(&self) -> Result<String, MessageRejectErrorEnum> {
122        let mut fld = field::ClOrdIDField::new(String::new());
123        self.message.body.get_field(tag::CL_ORD_ID, &mut fld.0)?;
124        Ok(fld.value().to_string())
125    }
126
127
128    /// Returns true if `ClOrdID` is present, Tag 11.
129    pub fn has_cl_ord_id(&self) -> bool {
130        self.message.body.has(tag::CL_ORD_ID)
131    }
132
133
134
135
136    /// Sets `ClientID`, Tag 109.
137    pub fn set_client_id(&mut self, v: String) {
138        self.message.body.set_field(tag::CLIENT_ID, FIXString::from(v));
139    }
140
141    /// Gets `ClientID`, Tag 109.
142    pub fn get_client_id(&self) -> Result<String, MessageRejectErrorEnum> {
143        let mut fld = field::ClientIDField::new(String::new());
144        self.message.body.get_field(tag::CLIENT_ID, &mut fld.0)?;
145        Ok(fld.value().to_string())
146    }
147
148
149    /// Returns true if `ClientID` is present, Tag 109.
150    pub fn has_client_id(&self) -> bool {
151        self.message.body.has(tag::CLIENT_ID)
152    }
153
154
155
156
157    /// Sets `CommType`, Tag 13.
158    pub fn set_comm_type(&mut self, v: String) {
159        self.message.body.set_field(tag::COMM_TYPE, FIXString::from(v));
160    }
161
162    /// Gets `CommType`, Tag 13.
163    pub fn get_comm_type(&self) -> Result<String, MessageRejectErrorEnum> {
164        let mut fld = field::CommTypeField::new(String::new());
165        self.message.body.get_field(tag::COMM_TYPE, &mut fld.0)?;
166        Ok(fld.value().to_string())
167    }
168
169
170    /// Returns true if `CommType` is present, Tag 13.
171    pub fn has_comm_type(&self) -> bool {
172        self.message.body.has(tag::COMM_TYPE)
173    }
174
175
176
177
178    /// Sets `Commission`, Tag 12.
179    pub fn set_commission(&mut self, val: Decimal, scale: i32) {
180        self.message.body.set_field(tag::COMMISSION, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
181    }
182
183    /// Gets `Commission`, Tag 12.
184    pub fn get_commission(&self) -> Result<Decimal, MessageRejectErrorEnum> {
185        let mut fld = field::CommissionField::new(Decimal::ZERO, 0);
186        self.message.body.get_field(tag::COMMISSION, &mut fld.0)?;
187        Ok(fld.value())
188    }
189
190
191    /// Returns true if `Commission` is present, Tag 12.
192    pub fn has_commission(&self) -> bool {
193        self.message.body.has(tag::COMMISSION)
194    }
195
196
197
198
199    /// Sets `CumQty`, Tag 14.
200    pub fn set_cum_qty(&mut self, val: Decimal, scale: i32) {
201        self.message.body.set_field(tag::CUM_QTY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
202    }
203
204    /// Gets `CumQty`, Tag 14.
205    pub fn get_cum_qty(&self) -> Result<Decimal, MessageRejectErrorEnum> {
206        let mut fld = field::CumQtyField::new(Decimal::ZERO, 0);
207        self.message.body.get_field(tag::CUM_QTY, &mut fld.0)?;
208        Ok(fld.value())
209    }
210
211
212    /// Returns true if `CumQty` is present, Tag 14.
213    pub fn has_cum_qty(&self) -> bool {
214        self.message.body.has(tag::CUM_QTY)
215    }
216
217
218
219
220    /// Sets `Currency`, Tag 15.
221    pub fn set_currency(&mut self, v: String) {
222        self.message.body.set_field(tag::CURRENCY, FIXString::from(v));
223    }
224
225    /// Gets `Currency`, Tag 15.
226    pub fn get_currency(&self) -> Result<String, MessageRejectErrorEnum> {
227        let mut fld = field::CurrencyField::new(String::new());
228        self.message.body.get_field(tag::CURRENCY, &mut fld.0)?;
229        Ok(fld.value().to_string())
230    }
231
232
233    /// Returns true if `Currency` is present, Tag 15.
234    pub fn has_currency(&self) -> bool {
235        self.message.body.has(tag::CURRENCY)
236    }
237
238
239
240
241    /// Sets `ExecBroker`, Tag 76.
242    pub fn set_exec_broker(&mut self, v: String) {
243        self.message.body.set_field(tag::EXEC_BROKER, FIXString::from(v));
244    }
245
246    /// Gets `ExecBroker`, Tag 76.
247    pub fn get_exec_broker(&self) -> Result<String, MessageRejectErrorEnum> {
248        let mut fld = field::ExecBrokerField::new(String::new());
249        self.message.body.get_field(tag::EXEC_BROKER, &mut fld.0)?;
250        Ok(fld.value().to_string())
251    }
252
253
254    /// Returns true if `ExecBroker` is present, Tag 76.
255    pub fn has_exec_broker(&self) -> bool {
256        self.message.body.has(tag::EXEC_BROKER)
257    }
258
259
260
261
262    /// Sets `ExecID`, Tag 17.
263    pub fn set_exec_id(&mut self, v: String) {
264        self.message.body.set_field(tag::EXEC_ID, FIXString::from(v));
265    }
266
267    /// Gets `ExecID`, Tag 17.
268    pub fn get_exec_id(&self) -> Result<String, MessageRejectErrorEnum> {
269        let mut fld = field::ExecIDField::new(String::new());
270        self.message.body.get_field(tag::EXEC_ID, &mut fld.0)?;
271        Ok(fld.value().to_string())
272    }
273
274
275    /// Returns true if `ExecID` is present, Tag 17.
276    pub fn has_exec_id(&self) -> bool {
277        self.message.body.has(tag::EXEC_ID)
278    }
279
280
281
282
283    /// Sets `ExecInst`, Tag 18.
284    pub fn set_exec_inst(&mut self, v: String) {
285        self.message.body.set_field(tag::EXEC_INST, FIXString::from(v));
286    }
287
288    /// Gets `ExecInst`, Tag 18.
289    pub fn get_exec_inst(&self) -> Result<String, MessageRejectErrorEnum> {
290        let mut fld = field::ExecInstField::new(String::new());
291        self.message.body.get_field(tag::EXEC_INST, &mut fld.0)?;
292        Ok(fld.value().to_string())
293    }
294
295
296    /// Returns true if `ExecInst` is present, Tag 18.
297    pub fn has_exec_inst(&self) -> bool {
298        self.message.body.has(tag::EXEC_INST)
299    }
300
301
302
303
304    /// Sets `ExecRefID`, Tag 19.
305    pub fn set_exec_ref_id(&mut self, v: String) {
306        self.message.body.set_field(tag::EXEC_REF_ID, FIXString::from(v));
307    }
308
309    /// Gets `ExecRefID`, Tag 19.
310    pub fn get_exec_ref_id(&self) -> Result<String, MessageRejectErrorEnum> {
311        let mut fld = field::ExecRefIDField::new(String::new());
312        self.message.body.get_field(tag::EXEC_REF_ID, &mut fld.0)?;
313        Ok(fld.value().to_string())
314    }
315
316
317    /// Returns true if `ExecRefID` is present, Tag 19.
318    pub fn has_exec_ref_id(&self) -> bool {
319        self.message.body.has(tag::EXEC_REF_ID)
320    }
321
322
323
324
325    /// Sets `ExecTransType`, Tag 20.
326    pub fn set_exec_trans_type(&mut self, v: String) {
327        self.message.body.set_field(tag::EXEC_TRANS_TYPE, FIXString::from(v));
328    }
329
330    /// Gets `ExecTransType`, Tag 20.
331    pub fn get_exec_trans_type(&self) -> Result<String, MessageRejectErrorEnum> {
332        let mut fld = field::ExecTransTypeField::new(String::new());
333        self.message.body.get_field(tag::EXEC_TRANS_TYPE, &mut fld.0)?;
334        Ok(fld.value().to_string())
335    }
336
337
338    /// Returns true if `ExecTransType` is present, Tag 20.
339    pub fn has_exec_trans_type(&self) -> bool {
340        self.message.body.has(tag::EXEC_TRANS_TYPE)
341    }
342
343
344
345
346    /// Sets `ExecType`, Tag 150.
347    pub fn set_exec_type(&mut self, v: String) {
348        self.message.body.set_field(tag::EXEC_TYPE, FIXString::from(v));
349    }
350
351    /// Gets `ExecType`, Tag 150.
352    pub fn get_exec_type(&self) -> Result<String, MessageRejectErrorEnum> {
353        let mut fld = field::ExecTypeField::new(String::new());
354        self.message.body.get_field(tag::EXEC_TYPE, &mut fld.0)?;
355        Ok(fld.value().to_string())
356    }
357
358
359    /// Returns true if `ExecType` is present, Tag 150.
360    pub fn has_exec_type(&self) -> bool {
361        self.message.body.has(tag::EXEC_TYPE)
362    }
363
364
365
366
367    /// Sets `ExpireTime`, Tag 126.
368    pub fn set_expire_time(&mut self, v: Timestamp) {
369        self.message.body.set_field(tag::EXPIRE_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
370            time: v,
371            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
372        });
373    }
374
375    /// Gets `ExpireTime`, Tag 126.
376    pub fn get_expire_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
377        let mut fld = field::ExpireTimeField::new(Timestamp::UNIX_EPOCH);
378        self.message.body.get_field(tag::EXPIRE_TIME, &mut fld.0)?;
379        Ok(fld.value())
380    }
381
382
383    /// Returns true if `ExpireTime` is present, Tag 126.
384    pub fn has_expire_time(&self) -> bool {
385        self.message.body.has(tag::EXPIRE_TIME)
386    }
387
388
389
390
391    /// Sets `FutSettDate`, Tag 64.
392    pub fn set_fut_sett_date(&mut self, v: String) {
393        self.message.body.set_field(tag::FUT_SETT_DATE, FIXString::from(v));
394    }
395
396    /// Gets `FutSettDate`, Tag 64.
397    pub fn get_fut_sett_date(&self) -> Result<String, MessageRejectErrorEnum> {
398        let mut fld = field::FutSettDateField::new(String::new());
399        self.message.body.get_field(tag::FUT_SETT_DATE, &mut fld.0)?;
400        Ok(fld.value().to_string())
401    }
402
403
404    /// Returns true if `FutSettDate` is present, Tag 64.
405    pub fn has_fut_sett_date(&self) -> bool {
406        self.message.body.has(tag::FUT_SETT_DATE)
407    }
408
409
410
411
412    /// Sets `IDSource`, Tag 22.
413    pub fn set_id_source(&mut self, v: String) {
414        self.message.body.set_field(tag::ID_SOURCE, FIXString::from(v));
415    }
416
417    /// Gets `IDSource`, Tag 22.
418    pub fn get_id_source(&self) -> Result<String, MessageRejectErrorEnum> {
419        let mut fld = field::IDSourceField::new(String::new());
420        self.message.body.get_field(tag::ID_SOURCE, &mut fld.0)?;
421        Ok(fld.value().to_string())
422    }
423
424
425    /// Returns true if `IDSource` is present, Tag 22.
426    pub fn has_id_source(&self) -> bool {
427        self.message.body.has(tag::ID_SOURCE)
428    }
429
430
431
432
433    /// Sets `Issuer`, Tag 106.
434    pub fn set_issuer(&mut self, v: String) {
435        self.message.body.set_field(tag::ISSUER, FIXString::from(v));
436    }
437
438    /// Gets `Issuer`, Tag 106.
439    pub fn get_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
440        let mut fld = field::IssuerField::new(String::new());
441        self.message.body.get_field(tag::ISSUER, &mut fld.0)?;
442        Ok(fld.value().to_string())
443    }
444
445
446    /// Returns true if `Issuer` is present, Tag 106.
447    pub fn has_issuer(&self) -> bool {
448        self.message.body.has(tag::ISSUER)
449    }
450
451
452
453
454    /// Sets `LastCapacity`, Tag 29.
455    pub fn set_last_capacity(&mut self, v: String) {
456        self.message.body.set_field(tag::LAST_CAPACITY, FIXString::from(v));
457    }
458
459    /// Gets `LastCapacity`, Tag 29.
460    pub fn get_last_capacity(&self) -> Result<String, MessageRejectErrorEnum> {
461        let mut fld = field::LastCapacityField::new(String::new());
462        self.message.body.get_field(tag::LAST_CAPACITY, &mut fld.0)?;
463        Ok(fld.value().to_string())
464    }
465
466
467    /// Returns true if `LastCapacity` is present, Tag 29.
468    pub fn has_last_capacity(&self) -> bool {
469        self.message.body.has(tag::LAST_CAPACITY)
470    }
471
472
473
474
475    /// Sets `LastForwardPoints`, Tag 195.
476    pub fn set_last_forward_points(&mut self, val: Decimal, scale: i32) {
477        self.message.body.set_field(tag::LAST_FORWARD_POINTS, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
478    }
479
480    /// Gets `LastForwardPoints`, Tag 195.
481    pub fn get_last_forward_points(&self) -> Result<Decimal, MessageRejectErrorEnum> {
482        let mut fld = field::LastForwardPointsField::new(Decimal::ZERO, 0);
483        self.message.body.get_field(tag::LAST_FORWARD_POINTS, &mut fld.0)?;
484        Ok(fld.value())
485    }
486
487
488    /// Returns true if `LastForwardPoints` is present, Tag 195.
489    pub fn has_last_forward_points(&self) -> bool {
490        self.message.body.has(tag::LAST_FORWARD_POINTS)
491    }
492
493
494
495
496    /// Sets `LastMkt`, Tag 30.
497    pub fn set_last_mkt(&mut self, v: String) {
498        self.message.body.set_field(tag::LAST_MKT, FIXString::from(v));
499    }
500
501    /// Gets `LastMkt`, Tag 30.
502    pub fn get_last_mkt(&self) -> Result<String, MessageRejectErrorEnum> {
503        let mut fld = field::LastMktField::new(String::new());
504        self.message.body.get_field(tag::LAST_MKT, &mut fld.0)?;
505        Ok(fld.value().to_string())
506    }
507
508
509    /// Returns true if `LastMkt` is present, Tag 30.
510    pub fn has_last_mkt(&self) -> bool {
511        self.message.body.has(tag::LAST_MKT)
512    }
513
514
515
516
517    /// Sets `LastPx`, Tag 31.
518    pub fn set_last_px(&mut self, val: Decimal, scale: i32) {
519        self.message.body.set_field(tag::LAST_PX, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
520    }
521
522    /// Gets `LastPx`, Tag 31.
523    pub fn get_last_px(&self) -> Result<Decimal, MessageRejectErrorEnum> {
524        let mut fld = field::LastPxField::new(Decimal::ZERO, 0);
525        self.message.body.get_field(tag::LAST_PX, &mut fld.0)?;
526        Ok(fld.value())
527    }
528
529
530    /// Returns true if `LastPx` is present, Tag 31.
531    pub fn has_last_px(&self) -> bool {
532        self.message.body.has(tag::LAST_PX)
533    }
534
535
536
537
538    /// Sets `LastShares`, Tag 32.
539    pub fn set_last_shares(&mut self, val: Decimal, scale: i32) {
540        self.message.body.set_field(tag::LAST_SHARES, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
541    }
542
543    /// Gets `LastShares`, Tag 32.
544    pub fn get_last_shares(&self) -> Result<Decimal, MessageRejectErrorEnum> {
545        let mut fld = field::LastSharesField::new(Decimal::ZERO, 0);
546        self.message.body.get_field(tag::LAST_SHARES, &mut fld.0)?;
547        Ok(fld.value())
548    }
549
550
551    /// Returns true if `LastShares` is present, Tag 32.
552    pub fn has_last_shares(&self) -> bool {
553        self.message.body.has(tag::LAST_SHARES)
554    }
555
556
557
558
559    /// Sets `LastSpotRate`, Tag 194.
560    pub fn set_last_spot_rate(&mut self, val: Decimal, scale: i32) {
561        self.message.body.set_field(tag::LAST_SPOT_RATE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
562    }
563
564    /// Gets `LastSpotRate`, Tag 194.
565    pub fn get_last_spot_rate(&self) -> Result<Decimal, MessageRejectErrorEnum> {
566        let mut fld = field::LastSpotRateField::new(Decimal::ZERO, 0);
567        self.message.body.get_field(tag::LAST_SPOT_RATE, &mut fld.0)?;
568        Ok(fld.value())
569    }
570
571
572    /// Returns true if `LastSpotRate` is present, Tag 194.
573    pub fn has_last_spot_rate(&self) -> bool {
574        self.message.body.has(tag::LAST_SPOT_RATE)
575    }
576
577
578
579
580    /// Sets `LeavesQty`, Tag 151.
581    pub fn set_leaves_qty(&mut self, val: Decimal, scale: i32) {
582        self.message.body.set_field(tag::LEAVES_QTY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
583    }
584
585    /// Gets `LeavesQty`, Tag 151.
586    pub fn get_leaves_qty(&self) -> Result<Decimal, MessageRejectErrorEnum> {
587        let mut fld = field::LeavesQtyField::new(Decimal::ZERO, 0);
588        self.message.body.get_field(tag::LEAVES_QTY, &mut fld.0)?;
589        Ok(fld.value())
590    }
591
592
593    /// Returns true if `LeavesQty` is present, Tag 151.
594    pub fn has_leaves_qty(&self) -> bool {
595        self.message.body.has(tag::LEAVES_QTY)
596    }
597
598
599
600
601    /// Sets `ListID`, Tag 66.
602    pub fn set_list_id(&mut self, v: String) {
603        self.message.body.set_field(tag::LIST_ID, FIXString::from(v));
604    }
605
606    /// Gets `ListID`, Tag 66.
607    pub fn get_list_id(&self) -> Result<String, MessageRejectErrorEnum> {
608        let mut fld = field::ListIDField::new(String::new());
609        self.message.body.get_field(tag::LIST_ID, &mut fld.0)?;
610        Ok(fld.value().to_string())
611    }
612
613
614    /// Returns true if `ListID` is present, Tag 66.
615    pub fn has_list_id(&self) -> bool {
616        self.message.body.has(tag::LIST_ID)
617    }
618
619
620
621
622    /// Sets `MaturityDay`, Tag 205.
623    pub fn set_maturity_day(&mut self, v: isize) {
624        self.message.body.set_field(tag::MATURITY_DAY, fixer::fix_int::FIXInt::from(v));
625    }
626
627    /// Gets `MaturityDay`, Tag 205.
628    pub fn get_maturity_day(&self) -> Result<isize, MessageRejectErrorEnum> {
629        let mut fld = field::MaturityDayField::new(0);
630        self.message.body.get_field(tag::MATURITY_DAY, &mut fld.0)?;
631        Ok(fld.value())
632    }
633
634
635    /// Returns true if `MaturityDay` is present, Tag 205.
636    pub fn has_maturity_day(&self) -> bool {
637        self.message.body.has(tag::MATURITY_DAY)
638    }
639
640
641
642
643    /// Sets `MaturityMonthYear`, Tag 200.
644    pub fn set_maturity_month_year(&mut self, v: String) {
645        self.message.body.set_field(tag::MATURITY_MONTH_YEAR, FIXString::from(v));
646    }
647
648    /// Gets `MaturityMonthYear`, Tag 200.
649    pub fn get_maturity_month_year(&self) -> Result<String, MessageRejectErrorEnum> {
650        let mut fld = field::MaturityMonthYearField::new(String::new());
651        self.message.body.get_field(tag::MATURITY_MONTH_YEAR, &mut fld.0)?;
652        Ok(fld.value().to_string())
653    }
654
655
656    /// Returns true if `MaturityMonthYear` is present, Tag 200.
657    pub fn has_maturity_month_year(&self) -> bool {
658        self.message.body.has(tag::MATURITY_MONTH_YEAR)
659    }
660
661
662
663
664    /// Sets `OptAttribute`, Tag 206.
665    pub fn set_opt_attribute(&mut self, v: String) {
666        self.message.body.set_field(tag::OPT_ATTRIBUTE, FIXString::from(v));
667    }
668
669    /// Gets `OptAttribute`, Tag 206.
670    pub fn get_opt_attribute(&self) -> Result<String, MessageRejectErrorEnum> {
671        let mut fld = field::OptAttributeField::new(String::new());
672        self.message.body.get_field(tag::OPT_ATTRIBUTE, &mut fld.0)?;
673        Ok(fld.value().to_string())
674    }
675
676
677    /// Returns true if `OptAttribute` is present, Tag 206.
678    pub fn has_opt_attribute(&self) -> bool {
679        self.message.body.has(tag::OPT_ATTRIBUTE)
680    }
681
682
683
684
685    /// Sets `OrdRejReason`, Tag 103.
686    pub fn set_ord_rej_reason(&mut self, v: isize) {
687        self.message.body.set_field(tag::ORD_REJ_REASON, fixer::fix_int::FIXInt::from(v));
688    }
689
690    /// Gets `OrdRejReason`, Tag 103.
691    pub fn get_ord_rej_reason(&self) -> Result<isize, MessageRejectErrorEnum> {
692        let mut fld = field::OrdRejReasonField::new(0);
693        self.message.body.get_field(tag::ORD_REJ_REASON, &mut fld.0)?;
694        Ok(fld.value())
695    }
696
697
698    /// Returns true if `OrdRejReason` is present, Tag 103.
699    pub fn has_ord_rej_reason(&self) -> bool {
700        self.message.body.has(tag::ORD_REJ_REASON)
701    }
702
703
704
705
706    /// Sets `OrdStatus`, Tag 39.
707    pub fn set_ord_status(&mut self, v: String) {
708        self.message.body.set_field(tag::ORD_STATUS, FIXString::from(v));
709    }
710
711    /// Gets `OrdStatus`, Tag 39.
712    pub fn get_ord_status(&self) -> Result<String, MessageRejectErrorEnum> {
713        let mut fld = field::OrdStatusField::new(String::new());
714        self.message.body.get_field(tag::ORD_STATUS, &mut fld.0)?;
715        Ok(fld.value().to_string())
716    }
717
718
719    /// Returns true if `OrdStatus` is present, Tag 39.
720    pub fn has_ord_status(&self) -> bool {
721        self.message.body.has(tag::ORD_STATUS)
722    }
723
724
725
726
727    /// Sets `OrdType`, Tag 40.
728    pub fn set_ord_type(&mut self, v: String) {
729        self.message.body.set_field(tag::ORD_TYPE, FIXString::from(v));
730    }
731
732    /// Gets `OrdType`, Tag 40.
733    pub fn get_ord_type(&self) -> Result<String, MessageRejectErrorEnum> {
734        let mut fld = field::OrdTypeField::new(String::new());
735        self.message.body.get_field(tag::ORD_TYPE, &mut fld.0)?;
736        Ok(fld.value().to_string())
737    }
738
739
740    /// Returns true if `OrdType` is present, Tag 40.
741    pub fn has_ord_type(&self) -> bool {
742        self.message.body.has(tag::ORD_TYPE)
743    }
744
745
746
747
748    /// Sets `OrderID`, Tag 37.
749    pub fn set_order_id(&mut self, v: String) {
750        self.message.body.set_field(tag::ORDER_ID, FIXString::from(v));
751    }
752
753    /// Gets `OrderID`, Tag 37.
754    pub fn get_order_id(&self) -> Result<String, MessageRejectErrorEnum> {
755        let mut fld = field::OrderIDField::new(String::new());
756        self.message.body.get_field(tag::ORDER_ID, &mut fld.0)?;
757        Ok(fld.value().to_string())
758    }
759
760
761    /// Returns true if `OrderID` is present, Tag 37.
762    pub fn has_order_id(&self) -> bool {
763        self.message.body.has(tag::ORDER_ID)
764    }
765
766
767
768
769    /// Sets `OrderQty`, Tag 38.
770    pub fn set_order_qty(&mut self, val: Decimal, scale: i32) {
771        self.message.body.set_field(tag::ORDER_QTY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
772    }
773
774    /// Gets `OrderQty`, Tag 38.
775    pub fn get_order_qty(&self) -> Result<Decimal, MessageRejectErrorEnum> {
776        let mut fld = field::OrderQtyField::new(Decimal::ZERO, 0);
777        self.message.body.get_field(tag::ORDER_QTY, &mut fld.0)?;
778        Ok(fld.value())
779    }
780
781
782    /// Returns true if `OrderQty` is present, Tag 38.
783    pub fn has_order_qty(&self) -> bool {
784        self.message.body.has(tag::ORDER_QTY)
785    }
786
787
788
789
790    /// Sets `OrigClOrdID`, Tag 41.
791    pub fn set_orig_cl_ord_id(&mut self, v: String) {
792        self.message.body.set_field(tag::ORIG_CL_ORD_ID, FIXString::from(v));
793    }
794
795    /// Gets `OrigClOrdID`, Tag 41.
796    pub fn get_orig_cl_ord_id(&self) -> Result<String, MessageRejectErrorEnum> {
797        let mut fld = field::OrigClOrdIDField::new(String::new());
798        self.message.body.get_field(tag::ORIG_CL_ORD_ID, &mut fld.0)?;
799        Ok(fld.value().to_string())
800    }
801
802
803    /// Returns true if `OrigClOrdID` is present, Tag 41.
804    pub fn has_orig_cl_ord_id(&self) -> bool {
805        self.message.body.has(tag::ORIG_CL_ORD_ID)
806    }
807
808
809
810
811    /// Sets `PegDifference`, Tag 211.
812    pub fn set_peg_difference(&mut self, val: Decimal, scale: i32) {
813        self.message.body.set_field(tag::PEG_DIFFERENCE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
814    }
815
816    /// Gets `PegDifference`, Tag 211.
817    pub fn get_peg_difference(&self) -> Result<Decimal, MessageRejectErrorEnum> {
818        let mut fld = field::PegDifferenceField::new(Decimal::ZERO, 0);
819        self.message.body.get_field(tag::PEG_DIFFERENCE, &mut fld.0)?;
820        Ok(fld.value())
821    }
822
823
824    /// Returns true if `PegDifference` is present, Tag 211.
825    pub fn has_peg_difference(&self) -> bool {
826        self.message.body.has(tag::PEG_DIFFERENCE)
827    }
828
829
830
831
832    /// Sets `Price`, Tag 44.
833    pub fn set_price(&mut self, val: Decimal, scale: i32) {
834        self.message.body.set_field(tag::PRICE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
835    }
836
837    /// Gets `Price`, Tag 44.
838    pub fn get_price(&self) -> Result<Decimal, MessageRejectErrorEnum> {
839        let mut fld = field::PriceField::new(Decimal::ZERO, 0);
840        self.message.body.get_field(tag::PRICE, &mut fld.0)?;
841        Ok(fld.value())
842    }
843
844
845    /// Returns true if `Price` is present, Tag 44.
846    pub fn has_price(&self) -> bool {
847        self.message.body.has(tag::PRICE)
848    }
849
850
851
852
853    /// Sets `PutOrCall`, Tag 201.
854    pub fn set_put_or_call(&mut self, v: isize) {
855        self.message.body.set_field(tag::PUT_OR_CALL, fixer::fix_int::FIXInt::from(v));
856    }
857
858    /// Gets `PutOrCall`, Tag 201.
859    pub fn get_put_or_call(&self) -> Result<isize, MessageRejectErrorEnum> {
860        let mut fld = field::PutOrCallField::new(0);
861        self.message.body.get_field(tag::PUT_OR_CALL, &mut fld.0)?;
862        Ok(fld.value())
863    }
864
865
866    /// Returns true if `PutOrCall` is present, Tag 201.
867    pub fn has_put_or_call(&self) -> bool {
868        self.message.body.has(tag::PUT_OR_CALL)
869    }
870
871
872
873
874    /// Sets `ReportToExch`, Tag 113.
875    pub fn set_report_to_exch(&mut self, v: bool) {
876        self.message.body.set_field(tag::REPORT_TO_EXCH, fixer::fix_boolean::FIXBoolean::from(v));
877    }
878
879    /// Gets `ReportToExch`, Tag 113.
880    pub fn get_report_to_exch(&self) -> Result<bool, MessageRejectErrorEnum> {
881        let mut fld = field::ReportToExchField::new(false);
882        self.message.body.get_field(tag::REPORT_TO_EXCH, &mut fld.0)?;
883        Ok(fld.value())
884    }
885
886
887    /// Returns true if `ReportToExch` is present, Tag 113.
888    pub fn has_report_to_exch(&self) -> bool {
889        self.message.body.has(tag::REPORT_TO_EXCH)
890    }
891
892
893
894
895    /// Sets `Rule80A`, Tag 47.
896    pub fn set_rule80_a(&mut self, v: String) {
897        self.message.body.set_field(tag::RULE80_A, FIXString::from(v));
898    }
899
900    /// Gets `Rule80A`, Tag 47.
901    pub fn get_rule80_a(&self) -> Result<String, MessageRejectErrorEnum> {
902        let mut fld = field::Rule80AField::new(String::new());
903        self.message.body.get_field(tag::RULE80_A, &mut fld.0)?;
904        Ok(fld.value().to_string())
905    }
906
907
908    /// Returns true if `Rule80A` is present, Tag 47.
909    pub fn has_rule80_a(&self) -> bool {
910        self.message.body.has(tag::RULE80_A)
911    }
912
913
914
915
916    /// Sets `SecondaryOrderID`, Tag 198.
917    pub fn set_secondary_order_id(&mut self, v: String) {
918        self.message.body.set_field(tag::SECONDARY_ORDER_ID, FIXString::from(v));
919    }
920
921    /// Gets `SecondaryOrderID`, Tag 198.
922    pub fn get_secondary_order_id(&self) -> Result<String, MessageRejectErrorEnum> {
923        let mut fld = field::SecondaryOrderIDField::new(String::new());
924        self.message.body.get_field(tag::SECONDARY_ORDER_ID, &mut fld.0)?;
925        Ok(fld.value().to_string())
926    }
927
928
929    /// Returns true if `SecondaryOrderID` is present, Tag 198.
930    pub fn has_secondary_order_id(&self) -> bool {
931        self.message.body.has(tag::SECONDARY_ORDER_ID)
932    }
933
934
935
936
937    /// Sets `SecurityDesc`, Tag 107.
938    pub fn set_security_desc(&mut self, v: String) {
939        self.message.body.set_field(tag::SECURITY_DESC, FIXString::from(v));
940    }
941
942    /// Gets `SecurityDesc`, Tag 107.
943    pub fn get_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
944        let mut fld = field::SecurityDescField::new(String::new());
945        self.message.body.get_field(tag::SECURITY_DESC, &mut fld.0)?;
946        Ok(fld.value().to_string())
947    }
948
949
950    /// Returns true if `SecurityDesc` is present, Tag 107.
951    pub fn has_security_desc(&self) -> bool {
952        self.message.body.has(tag::SECURITY_DESC)
953    }
954
955
956
957
958    /// Sets `SecurityExchange`, Tag 207.
959    pub fn set_security_exchange(&mut self, v: String) {
960        self.message.body.set_field(tag::SECURITY_EXCHANGE, FIXString::from(v));
961    }
962
963    /// Gets `SecurityExchange`, Tag 207.
964    pub fn get_security_exchange(&self) -> Result<String, MessageRejectErrorEnum> {
965        let mut fld = field::SecurityExchangeField::new(String::new());
966        self.message.body.get_field(tag::SECURITY_EXCHANGE, &mut fld.0)?;
967        Ok(fld.value().to_string())
968    }
969
970
971    /// Returns true if `SecurityExchange` is present, Tag 207.
972    pub fn has_security_exchange(&self) -> bool {
973        self.message.body.has(tag::SECURITY_EXCHANGE)
974    }
975
976
977
978
979    /// Sets `SecurityID`, Tag 48.
980    pub fn set_security_id(&mut self, v: String) {
981        self.message.body.set_field(tag::SECURITY_ID, FIXString::from(v));
982    }
983
984    /// Gets `SecurityID`, Tag 48.
985    pub fn get_security_id(&self) -> Result<String, MessageRejectErrorEnum> {
986        let mut fld = field::SecurityIDField::new(String::new());
987        self.message.body.get_field(tag::SECURITY_ID, &mut fld.0)?;
988        Ok(fld.value().to_string())
989    }
990
991
992    /// Returns true if `SecurityID` is present, Tag 48.
993    pub fn has_security_id(&self) -> bool {
994        self.message.body.has(tag::SECURITY_ID)
995    }
996
997
998
999
1000    /// Sets `SecurityType`, Tag 167.
1001    pub fn set_security_type(&mut self, v: String) {
1002        self.message.body.set_field(tag::SECURITY_TYPE, FIXString::from(v));
1003    }
1004
1005    /// Gets `SecurityType`, Tag 167.
1006    pub fn get_security_type(&self) -> Result<String, MessageRejectErrorEnum> {
1007        let mut fld = field::SecurityTypeField::new(String::new());
1008        self.message.body.get_field(tag::SECURITY_TYPE, &mut fld.0)?;
1009        Ok(fld.value().to_string())
1010    }
1011
1012
1013    /// Returns true if `SecurityType` is present, Tag 167.
1014    pub fn has_security_type(&self) -> bool {
1015        self.message.body.has(tag::SECURITY_TYPE)
1016    }
1017
1018
1019
1020
1021    /// Sets `SettlCurrAmt`, Tag 119.
1022    pub fn set_settl_curr_amt(&mut self, val: Decimal, scale: i32) {
1023        self.message.body.set_field(tag::SETTL_CURR_AMT, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1024    }
1025
1026    /// Gets `SettlCurrAmt`, Tag 119.
1027    pub fn get_settl_curr_amt(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1028        let mut fld = field::SettlCurrAmtField::new(Decimal::ZERO, 0);
1029        self.message.body.get_field(tag::SETTL_CURR_AMT, &mut fld.0)?;
1030        Ok(fld.value())
1031    }
1032
1033
1034    /// Returns true if `SettlCurrAmt` is present, Tag 119.
1035    pub fn has_settl_curr_amt(&self) -> bool {
1036        self.message.body.has(tag::SETTL_CURR_AMT)
1037    }
1038
1039
1040
1041
1042    /// Sets `SettlCurrFxRate`, Tag 155.
1043    pub fn set_settl_curr_fx_rate(&mut self, val: Decimal, scale: i32) {
1044        self.message.body.set_field(tag::SETTL_CURR_FX_RATE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1045    }
1046
1047    /// Gets `SettlCurrFxRate`, Tag 155.
1048    pub fn get_settl_curr_fx_rate(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1049        let mut fld = field::SettlCurrFxRateField::new(Decimal::ZERO, 0);
1050        self.message.body.get_field(tag::SETTL_CURR_FX_RATE, &mut fld.0)?;
1051        Ok(fld.value())
1052    }
1053
1054
1055    /// Returns true if `SettlCurrFxRate` is present, Tag 155.
1056    pub fn has_settl_curr_fx_rate(&self) -> bool {
1057        self.message.body.has(tag::SETTL_CURR_FX_RATE)
1058    }
1059
1060
1061
1062
1063    /// Sets `SettlCurrFxRateCalc`, Tag 156.
1064    pub fn set_settl_curr_fx_rate_calc(&mut self, v: String) {
1065        self.message.body.set_field(tag::SETTL_CURR_FX_RATE_CALC, FIXString::from(v));
1066    }
1067
1068    /// Gets `SettlCurrFxRateCalc`, Tag 156.
1069    pub fn get_settl_curr_fx_rate_calc(&self) -> Result<String, MessageRejectErrorEnum> {
1070        let mut fld = field::SettlCurrFxRateCalcField::new(String::new());
1071        self.message.body.get_field(tag::SETTL_CURR_FX_RATE_CALC, &mut fld.0)?;
1072        Ok(fld.value().to_string())
1073    }
1074
1075
1076    /// Returns true if `SettlCurrFxRateCalc` is present, Tag 156.
1077    pub fn has_settl_curr_fx_rate_calc(&self) -> bool {
1078        self.message.body.has(tag::SETTL_CURR_FX_RATE_CALC)
1079    }
1080
1081
1082
1083
1084    /// Sets `SettlCurrency`, Tag 120.
1085    pub fn set_settl_currency(&mut self, v: String) {
1086        self.message.body.set_field(tag::SETTL_CURRENCY, FIXString::from(v));
1087    }
1088
1089    /// Gets `SettlCurrency`, Tag 120.
1090    pub fn get_settl_currency(&self) -> Result<String, MessageRejectErrorEnum> {
1091        let mut fld = field::SettlCurrencyField::new(String::new());
1092        self.message.body.get_field(tag::SETTL_CURRENCY, &mut fld.0)?;
1093        Ok(fld.value().to_string())
1094    }
1095
1096
1097    /// Returns true if `SettlCurrency` is present, Tag 120.
1098    pub fn has_settl_currency(&self) -> bool {
1099        self.message.body.has(tag::SETTL_CURRENCY)
1100    }
1101
1102
1103
1104
1105    /// Sets `SettlmntTyp`, Tag 63.
1106    pub fn set_settlmnt_typ(&mut self, v: String) {
1107        self.message.body.set_field(tag::SETTLMNT_TYP, FIXString::from(v));
1108    }
1109
1110    /// Gets `SettlmntTyp`, Tag 63.
1111    pub fn get_settlmnt_typ(&self) -> Result<String, MessageRejectErrorEnum> {
1112        let mut fld = field::SettlmntTypField::new(String::new());
1113        self.message.body.get_field(tag::SETTLMNT_TYP, &mut fld.0)?;
1114        Ok(fld.value().to_string())
1115    }
1116
1117
1118    /// Returns true if `SettlmntTyp` is present, Tag 63.
1119    pub fn has_settlmnt_typ(&self) -> bool {
1120        self.message.body.has(tag::SETTLMNT_TYP)
1121    }
1122
1123
1124
1125
1126    /// Sets `Side`, Tag 54.
1127    pub fn set_side(&mut self, v: String) {
1128        self.message.body.set_field(tag::SIDE, FIXString::from(v));
1129    }
1130
1131    /// Gets `Side`, Tag 54.
1132    pub fn get_side(&self) -> Result<String, MessageRejectErrorEnum> {
1133        let mut fld = field::SideField::new(String::new());
1134        self.message.body.get_field(tag::SIDE, &mut fld.0)?;
1135        Ok(fld.value().to_string())
1136    }
1137
1138
1139    /// Returns true if `Side` is present, Tag 54.
1140    pub fn has_side(&self) -> bool {
1141        self.message.body.has(tag::SIDE)
1142    }
1143
1144
1145
1146
1147    /// Sets `StopPx`, Tag 99.
1148    pub fn set_stop_px(&mut self, val: Decimal, scale: i32) {
1149        self.message.body.set_field(tag::STOP_PX, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1150    }
1151
1152    /// Gets `StopPx`, Tag 99.
1153    pub fn get_stop_px(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1154        let mut fld = field::StopPxField::new(Decimal::ZERO, 0);
1155        self.message.body.get_field(tag::STOP_PX, &mut fld.0)?;
1156        Ok(fld.value())
1157    }
1158
1159
1160    /// Returns true if `StopPx` is present, Tag 99.
1161    pub fn has_stop_px(&self) -> bool {
1162        self.message.body.has(tag::STOP_PX)
1163    }
1164
1165
1166
1167
1168    /// Sets `StrikePrice`, Tag 202.
1169    pub fn set_strike_price(&mut self, val: Decimal, scale: i32) {
1170        self.message.body.set_field(tag::STRIKE_PRICE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1171    }
1172
1173    /// Gets `StrikePrice`, Tag 202.
1174    pub fn get_strike_price(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1175        let mut fld = field::StrikePriceField::new(Decimal::ZERO, 0);
1176        self.message.body.get_field(tag::STRIKE_PRICE, &mut fld.0)?;
1177        Ok(fld.value())
1178    }
1179
1180
1181    /// Returns true if `StrikePrice` is present, Tag 202.
1182    pub fn has_strike_price(&self) -> bool {
1183        self.message.body.has(tag::STRIKE_PRICE)
1184    }
1185
1186
1187
1188
1189    /// Sets `Symbol`, Tag 55.
1190    pub fn set_symbol(&mut self, v: String) {
1191        self.message.body.set_field(tag::SYMBOL, FIXString::from(v));
1192    }
1193
1194    /// Gets `Symbol`, Tag 55.
1195    pub fn get_symbol(&self) -> Result<String, MessageRejectErrorEnum> {
1196        let mut fld = field::SymbolField::new(String::new());
1197        self.message.body.get_field(tag::SYMBOL, &mut fld.0)?;
1198        Ok(fld.value().to_string())
1199    }
1200
1201
1202    /// Returns true if `Symbol` is present, Tag 55.
1203    pub fn has_symbol(&self) -> bool {
1204        self.message.body.has(tag::SYMBOL)
1205    }
1206
1207
1208
1209
1210    /// Sets `SymbolSfx`, Tag 65.
1211    pub fn set_symbol_sfx(&mut self, v: String) {
1212        self.message.body.set_field(tag::SYMBOL_SFX, FIXString::from(v));
1213    }
1214
1215    /// Gets `SymbolSfx`, Tag 65.
1216    pub fn get_symbol_sfx(&self) -> Result<String, MessageRejectErrorEnum> {
1217        let mut fld = field::SymbolSfxField::new(String::new());
1218        self.message.body.get_field(tag::SYMBOL_SFX, &mut fld.0)?;
1219        Ok(fld.value().to_string())
1220    }
1221
1222
1223    /// Returns true if `SymbolSfx` is present, Tag 65.
1224    pub fn has_symbol_sfx(&self) -> bool {
1225        self.message.body.has(tag::SYMBOL_SFX)
1226    }
1227
1228
1229
1230
1231    /// Sets `Text`, Tag 58.
1232    pub fn set_text(&mut self, v: String) {
1233        self.message.body.set_field(tag::TEXT, FIXString::from(v));
1234    }
1235
1236    /// Gets `Text`, Tag 58.
1237    pub fn get_text(&self) -> Result<String, MessageRejectErrorEnum> {
1238        let mut fld = field::TextField::new(String::new());
1239        self.message.body.get_field(tag::TEXT, &mut fld.0)?;
1240        Ok(fld.value().to_string())
1241    }
1242
1243
1244    /// Returns true if `Text` is present, Tag 58.
1245    pub fn has_text(&self) -> bool {
1246        self.message.body.has(tag::TEXT)
1247    }
1248
1249
1250
1251
1252    /// Sets `TimeInForce`, Tag 59.
1253    pub fn set_time_in_force(&mut self, v: String) {
1254        self.message.body.set_field(tag::TIME_IN_FORCE, FIXString::from(v));
1255    }
1256
1257    /// Gets `TimeInForce`, Tag 59.
1258    pub fn get_time_in_force(&self) -> Result<String, MessageRejectErrorEnum> {
1259        let mut fld = field::TimeInForceField::new(String::new());
1260        self.message.body.get_field(tag::TIME_IN_FORCE, &mut fld.0)?;
1261        Ok(fld.value().to_string())
1262    }
1263
1264
1265    /// Returns true if `TimeInForce` is present, Tag 59.
1266    pub fn has_time_in_force(&self) -> bool {
1267        self.message.body.has(tag::TIME_IN_FORCE)
1268    }
1269
1270
1271
1272
1273    /// Sets `TradeDate`, Tag 75.
1274    pub fn set_trade_date(&mut self, v: String) {
1275        self.message.body.set_field(tag::TRADE_DATE, FIXString::from(v));
1276    }
1277
1278    /// Gets `TradeDate`, Tag 75.
1279    pub fn get_trade_date(&self) -> Result<String, MessageRejectErrorEnum> {
1280        let mut fld = field::TradeDateField::new(String::new());
1281        self.message.body.get_field(tag::TRADE_DATE, &mut fld.0)?;
1282        Ok(fld.value().to_string())
1283    }
1284
1285
1286    /// Returns true if `TradeDate` is present, Tag 75.
1287    pub fn has_trade_date(&self) -> bool {
1288        self.message.body.has(tag::TRADE_DATE)
1289    }
1290
1291
1292
1293
1294    /// Sets `TransactTime`, Tag 60.
1295    pub fn set_transact_time(&mut self, v: Timestamp) {
1296        self.message.body.set_field(tag::TRANSACT_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
1297            time: v,
1298            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
1299        });
1300    }
1301
1302    /// Gets `TransactTime`, Tag 60.
1303    pub fn get_transact_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
1304        let mut fld = field::TransactTimeField::new(Timestamp::UNIX_EPOCH);
1305        self.message.body.get_field(tag::TRANSACT_TIME, &mut fld.0)?;
1306        Ok(fld.value())
1307    }
1308
1309
1310    /// Returns true if `TransactTime` is present, Tag 60.
1311    pub fn has_transact_time(&self) -> bool {
1312        self.message.body.has(tag::TRANSACT_TIME)
1313    }
1314
1315
1316}
1317
1318/// `RouteOut` is the callback type for routing `ExecutionReport` messages.
1319pub type RouteOut = fn(msg: ExecutionReport, session_id: SessionID) -> Result<(), MessageRejectErrorEnum>;
1320
1321/// Route type returned by the `route` function.
1322pub type Route = (&'static str, &'static str, Box<dyn Fn(&Message, SessionID) -> Result<(), MessageRejectErrorEnum> + Send>);
1323
1324/// Returns the begin string, message type, and route function for `ExecutionReport`.
1325pub fn route(router: RouteOut) -> Route {
1326    let r = move |msg: &Message, session_id: SessionID| -> Result<(), MessageRejectErrorEnum> {
1327        router(ExecutionReport::from_message(msg.clone()), session_id)
1328    };
1329    ("FIX.4.1", "8", Box::new(r))
1330}