Skip to main content

fixer_fix/fix41/
quote.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/// `Quote` is the `fix41` `Quote` type, `MsgType` = S.
21pub struct Quote {
22    pub message: Message,
23}
24
25impl Quote {
26    /// Creates a new `Quote` with required fields.
27    pub fn new(quote_id: field::QuoteIDField, symbol: field::SymbolField) -> Self {
28        let mut msg = Message::new();
29        msg.header.set_field(tag::MSG_TYPE, FIXString::from("S".to_string()));
30
31        msg.body.set_field(tag::QUOTE_ID, quote_id.0);
32
33        msg.body.set_field(tag::SYMBOL, symbol.0);
34
35        Self { message: msg }
36    }
37
38    /// Creates a `Quote` from an existing `Message`.
39    pub fn from_message(msg: Message) -> Self {
40        Self { message: msg }
41    }
42
43    /// Returns the underlying `Message`.
44    pub fn to_message(self) -> Message {
45        self.message
46    }
47
48
49
50
51    /// Sets `BidForwardPoints`, Tag 189.
52    pub fn set_bid_forward_points(&mut self, val: Decimal, scale: i32) {
53        self.message.body.set_field(tag::BID_FORWARD_POINTS, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
54    }
55
56    /// Gets `BidForwardPoints`, Tag 189.
57    pub fn get_bid_forward_points(&self) -> Result<Decimal, MessageRejectErrorEnum> {
58        let mut fld = field::BidForwardPointsField::new(Decimal::ZERO, 0);
59        self.message.body.get_field(tag::BID_FORWARD_POINTS, &mut fld.0)?;
60        Ok(fld.value())
61    }
62
63
64    /// Returns true if `BidForwardPoints` is present, Tag 189.
65    pub fn has_bid_forward_points(&self) -> bool {
66        self.message.body.has(tag::BID_FORWARD_POINTS)
67    }
68
69
70
71
72    /// Sets `BidPx`, Tag 132.
73    pub fn set_bid_px(&mut self, val: Decimal, scale: i32) {
74        self.message.body.set_field(tag::BID_PX, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
75    }
76
77    /// Gets `BidPx`, Tag 132.
78    pub fn get_bid_px(&self) -> Result<Decimal, MessageRejectErrorEnum> {
79        let mut fld = field::BidPxField::new(Decimal::ZERO, 0);
80        self.message.body.get_field(tag::BID_PX, &mut fld.0)?;
81        Ok(fld.value())
82    }
83
84
85    /// Returns true if `BidPx` is present, Tag 132.
86    pub fn has_bid_px(&self) -> bool {
87        self.message.body.has(tag::BID_PX)
88    }
89
90
91
92
93    /// Sets `BidSize`, Tag 134.
94    pub fn set_bid_size(&mut self, val: Decimal, scale: i32) {
95        self.message.body.set_field(tag::BID_SIZE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
96    }
97
98    /// Gets `BidSize`, Tag 134.
99    pub fn get_bid_size(&self) -> Result<Decimal, MessageRejectErrorEnum> {
100        let mut fld = field::BidSizeField::new(Decimal::ZERO, 0);
101        self.message.body.get_field(tag::BID_SIZE, &mut fld.0)?;
102        Ok(fld.value())
103    }
104
105
106    /// Returns true if `BidSize` is present, Tag 134.
107    pub fn has_bid_size(&self) -> bool {
108        self.message.body.has(tag::BID_SIZE)
109    }
110
111
112
113
114    /// Sets `BidSpotRate`, Tag 188.
115    pub fn set_bid_spot_rate(&mut self, val: Decimal, scale: i32) {
116        self.message.body.set_field(tag::BID_SPOT_RATE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
117    }
118
119    /// Gets `BidSpotRate`, Tag 188.
120    pub fn get_bid_spot_rate(&self) -> Result<Decimal, MessageRejectErrorEnum> {
121        let mut fld = field::BidSpotRateField::new(Decimal::ZERO, 0);
122        self.message.body.get_field(tag::BID_SPOT_RATE, &mut fld.0)?;
123        Ok(fld.value())
124    }
125
126
127    /// Returns true if `BidSpotRate` is present, Tag 188.
128    pub fn has_bid_spot_rate(&self) -> bool {
129        self.message.body.has(tag::BID_SPOT_RATE)
130    }
131
132
133
134
135    /// Sets `FutSettDate`, Tag 64.
136    pub fn set_fut_sett_date(&mut self, v: String) {
137        self.message.body.set_field(tag::FUT_SETT_DATE, FIXString::from(v));
138    }
139
140    /// Gets `FutSettDate`, Tag 64.
141    pub fn get_fut_sett_date(&self) -> Result<String, MessageRejectErrorEnum> {
142        let mut fld = field::FutSettDateField::new(String::new());
143        self.message.body.get_field(tag::FUT_SETT_DATE, &mut fld.0)?;
144        Ok(fld.value().to_string())
145    }
146
147
148    /// Returns true if `FutSettDate` is present, Tag 64.
149    pub fn has_fut_sett_date(&self) -> bool {
150        self.message.body.has(tag::FUT_SETT_DATE)
151    }
152
153
154
155
156    /// Sets `FutSettDate2`, Tag 193.
157    pub fn set_fut_sett_date2(&mut self, v: String) {
158        self.message.body.set_field(tag::FUT_SETT_DATE2, FIXString::from(v));
159    }
160
161    /// Gets `FutSettDate2`, Tag 193.
162    pub fn get_fut_sett_date2(&self) -> Result<String, MessageRejectErrorEnum> {
163        let mut fld = field::FutSettDate2Field::new(String::new());
164        self.message.body.get_field(tag::FUT_SETT_DATE2, &mut fld.0)?;
165        Ok(fld.value().to_string())
166    }
167
168
169    /// Returns true if `FutSettDate2` is present, Tag 193.
170    pub fn has_fut_sett_date2(&self) -> bool {
171        self.message.body.has(tag::FUT_SETT_DATE2)
172    }
173
174
175
176
177    /// Sets `IDSource`, Tag 22.
178    pub fn set_id_source(&mut self, v: String) {
179        self.message.body.set_field(tag::ID_SOURCE, FIXString::from(v));
180    }
181
182    /// Gets `IDSource`, Tag 22.
183    pub fn get_id_source(&self) -> Result<String, MessageRejectErrorEnum> {
184        let mut fld = field::IDSourceField::new(String::new());
185        self.message.body.get_field(tag::ID_SOURCE, &mut fld.0)?;
186        Ok(fld.value().to_string())
187    }
188
189
190    /// Returns true if `IDSource` is present, Tag 22.
191    pub fn has_id_source(&self) -> bool {
192        self.message.body.has(tag::ID_SOURCE)
193    }
194
195
196
197
198    /// Sets `Issuer`, Tag 106.
199    pub fn set_issuer(&mut self, v: String) {
200        self.message.body.set_field(tag::ISSUER, FIXString::from(v));
201    }
202
203    /// Gets `Issuer`, Tag 106.
204    pub fn get_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
205        let mut fld = field::IssuerField::new(String::new());
206        self.message.body.get_field(tag::ISSUER, &mut fld.0)?;
207        Ok(fld.value().to_string())
208    }
209
210
211    /// Returns true if `Issuer` is present, Tag 106.
212    pub fn has_issuer(&self) -> bool {
213        self.message.body.has(tag::ISSUER)
214    }
215
216
217
218
219    /// Sets `MaturityDay`, Tag 205.
220    pub fn set_maturity_day(&mut self, v: isize) {
221        self.message.body.set_field(tag::MATURITY_DAY, fixer::fix_int::FIXInt::from(v));
222    }
223
224    /// Gets `MaturityDay`, Tag 205.
225    pub fn get_maturity_day(&self) -> Result<isize, MessageRejectErrorEnum> {
226        let mut fld = field::MaturityDayField::new(0);
227        self.message.body.get_field(tag::MATURITY_DAY, &mut fld.0)?;
228        Ok(fld.value())
229    }
230
231
232    /// Returns true if `MaturityDay` is present, Tag 205.
233    pub fn has_maturity_day(&self) -> bool {
234        self.message.body.has(tag::MATURITY_DAY)
235    }
236
237
238
239
240    /// Sets `MaturityMonthYear`, Tag 200.
241    pub fn set_maturity_month_year(&mut self, v: String) {
242        self.message.body.set_field(tag::MATURITY_MONTH_YEAR, FIXString::from(v));
243    }
244
245    /// Gets `MaturityMonthYear`, Tag 200.
246    pub fn get_maturity_month_year(&self) -> Result<String, MessageRejectErrorEnum> {
247        let mut fld = field::MaturityMonthYearField::new(String::new());
248        self.message.body.get_field(tag::MATURITY_MONTH_YEAR, &mut fld.0)?;
249        Ok(fld.value().to_string())
250    }
251
252
253    /// Returns true if `MaturityMonthYear` is present, Tag 200.
254    pub fn has_maturity_month_year(&self) -> bool {
255        self.message.body.has(tag::MATURITY_MONTH_YEAR)
256    }
257
258
259
260
261    /// Sets `OfferForwardPoints`, Tag 191.
262    pub fn set_offer_forward_points(&mut self, val: Decimal, scale: i32) {
263        self.message.body.set_field(tag::OFFER_FORWARD_POINTS, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
264    }
265
266    /// Gets `OfferForwardPoints`, Tag 191.
267    pub fn get_offer_forward_points(&self) -> Result<Decimal, MessageRejectErrorEnum> {
268        let mut fld = field::OfferForwardPointsField::new(Decimal::ZERO, 0);
269        self.message.body.get_field(tag::OFFER_FORWARD_POINTS, &mut fld.0)?;
270        Ok(fld.value())
271    }
272
273
274    /// Returns true if `OfferForwardPoints` is present, Tag 191.
275    pub fn has_offer_forward_points(&self) -> bool {
276        self.message.body.has(tag::OFFER_FORWARD_POINTS)
277    }
278
279
280
281
282    /// Sets `OfferPx`, Tag 133.
283    pub fn set_offer_px(&mut self, val: Decimal, scale: i32) {
284        self.message.body.set_field(tag::OFFER_PX, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
285    }
286
287    /// Gets `OfferPx`, Tag 133.
288    pub fn get_offer_px(&self) -> Result<Decimal, MessageRejectErrorEnum> {
289        let mut fld = field::OfferPxField::new(Decimal::ZERO, 0);
290        self.message.body.get_field(tag::OFFER_PX, &mut fld.0)?;
291        Ok(fld.value())
292    }
293
294
295    /// Returns true if `OfferPx` is present, Tag 133.
296    pub fn has_offer_px(&self) -> bool {
297        self.message.body.has(tag::OFFER_PX)
298    }
299
300
301
302
303    /// Sets `OfferSize`, Tag 135.
304    pub fn set_offer_size(&mut self, val: Decimal, scale: i32) {
305        self.message.body.set_field(tag::OFFER_SIZE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
306    }
307
308    /// Gets `OfferSize`, Tag 135.
309    pub fn get_offer_size(&self) -> Result<Decimal, MessageRejectErrorEnum> {
310        let mut fld = field::OfferSizeField::new(Decimal::ZERO, 0);
311        self.message.body.get_field(tag::OFFER_SIZE, &mut fld.0)?;
312        Ok(fld.value())
313    }
314
315
316    /// Returns true if `OfferSize` is present, Tag 135.
317    pub fn has_offer_size(&self) -> bool {
318        self.message.body.has(tag::OFFER_SIZE)
319    }
320
321
322
323
324    /// Sets `OfferSpotRate`, Tag 190.
325    pub fn set_offer_spot_rate(&mut self, val: Decimal, scale: i32) {
326        self.message.body.set_field(tag::OFFER_SPOT_RATE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
327    }
328
329    /// Gets `OfferSpotRate`, Tag 190.
330    pub fn get_offer_spot_rate(&self) -> Result<Decimal, MessageRejectErrorEnum> {
331        let mut fld = field::OfferSpotRateField::new(Decimal::ZERO, 0);
332        self.message.body.get_field(tag::OFFER_SPOT_RATE, &mut fld.0)?;
333        Ok(fld.value())
334    }
335
336
337    /// Returns true if `OfferSpotRate` is present, Tag 190.
338    pub fn has_offer_spot_rate(&self) -> bool {
339        self.message.body.has(tag::OFFER_SPOT_RATE)
340    }
341
342
343
344
345    /// Sets `OptAttribute`, Tag 206.
346    pub fn set_opt_attribute(&mut self, v: String) {
347        self.message.body.set_field(tag::OPT_ATTRIBUTE, FIXString::from(v));
348    }
349
350    /// Gets `OptAttribute`, Tag 206.
351    pub fn get_opt_attribute(&self) -> Result<String, MessageRejectErrorEnum> {
352        let mut fld = field::OptAttributeField::new(String::new());
353        self.message.body.get_field(tag::OPT_ATTRIBUTE, &mut fld.0)?;
354        Ok(fld.value().to_string())
355    }
356
357
358    /// Returns true if `OptAttribute` is present, Tag 206.
359    pub fn has_opt_attribute(&self) -> bool {
360        self.message.body.has(tag::OPT_ATTRIBUTE)
361    }
362
363
364
365
366    /// Sets `OrdType`, Tag 40.
367    pub fn set_ord_type(&mut self, v: String) {
368        self.message.body.set_field(tag::ORD_TYPE, FIXString::from(v));
369    }
370
371    /// Gets `OrdType`, Tag 40.
372    pub fn get_ord_type(&self) -> Result<String, MessageRejectErrorEnum> {
373        let mut fld = field::OrdTypeField::new(String::new());
374        self.message.body.get_field(tag::ORD_TYPE, &mut fld.0)?;
375        Ok(fld.value().to_string())
376    }
377
378
379    /// Returns true if `OrdType` is present, Tag 40.
380    pub fn has_ord_type(&self) -> bool {
381        self.message.body.has(tag::ORD_TYPE)
382    }
383
384
385
386
387    /// Sets `OrderQty2`, Tag 192.
388    pub fn set_order_qty2(&mut self, val: Decimal, scale: i32) {
389        self.message.body.set_field(tag::ORDER_QTY2, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
390    }
391
392    /// Gets `OrderQty2`, Tag 192.
393    pub fn get_order_qty2(&self) -> Result<Decimal, MessageRejectErrorEnum> {
394        let mut fld = field::OrderQty2Field::new(Decimal::ZERO, 0);
395        self.message.body.get_field(tag::ORDER_QTY2, &mut fld.0)?;
396        Ok(fld.value())
397    }
398
399
400    /// Returns true if `OrderQty2` is present, Tag 192.
401    pub fn has_order_qty2(&self) -> bool {
402        self.message.body.has(tag::ORDER_QTY2)
403    }
404
405
406
407
408    /// Sets `PutOrCall`, Tag 201.
409    pub fn set_put_or_call(&mut self, v: isize) {
410        self.message.body.set_field(tag::PUT_OR_CALL, fixer::fix_int::FIXInt::from(v));
411    }
412
413    /// Gets `PutOrCall`, Tag 201.
414    pub fn get_put_or_call(&self) -> Result<isize, MessageRejectErrorEnum> {
415        let mut fld = field::PutOrCallField::new(0);
416        self.message.body.get_field(tag::PUT_OR_CALL, &mut fld.0)?;
417        Ok(fld.value())
418    }
419
420
421    /// Returns true if `PutOrCall` is present, Tag 201.
422    pub fn has_put_or_call(&self) -> bool {
423        self.message.body.has(tag::PUT_OR_CALL)
424    }
425
426
427
428
429    /// Sets `QuoteID`, Tag 117.
430    pub fn set_quote_id(&mut self, v: String) {
431        self.message.body.set_field(tag::QUOTE_ID, FIXString::from(v));
432    }
433
434    /// Gets `QuoteID`, Tag 117.
435    pub fn get_quote_id(&self) -> Result<String, MessageRejectErrorEnum> {
436        let mut fld = field::QuoteIDField::new(String::new());
437        self.message.body.get_field(tag::QUOTE_ID, &mut fld.0)?;
438        Ok(fld.value().to_string())
439    }
440
441
442    /// Returns true if `QuoteID` is present, Tag 117.
443    pub fn has_quote_id(&self) -> bool {
444        self.message.body.has(tag::QUOTE_ID)
445    }
446
447
448
449
450    /// Sets `QuoteReqID`, Tag 131.
451    pub fn set_quote_req_id(&mut self, v: String) {
452        self.message.body.set_field(tag::QUOTE_REQ_ID, FIXString::from(v));
453    }
454
455    /// Gets `QuoteReqID`, Tag 131.
456    pub fn get_quote_req_id(&self) -> Result<String, MessageRejectErrorEnum> {
457        let mut fld = field::QuoteReqIDField::new(String::new());
458        self.message.body.get_field(tag::QUOTE_REQ_ID, &mut fld.0)?;
459        Ok(fld.value().to_string())
460    }
461
462
463    /// Returns true if `QuoteReqID` is present, Tag 131.
464    pub fn has_quote_req_id(&self) -> bool {
465        self.message.body.has(tag::QUOTE_REQ_ID)
466    }
467
468
469
470
471    /// Sets `SecurityDesc`, Tag 107.
472    pub fn set_security_desc(&mut self, v: String) {
473        self.message.body.set_field(tag::SECURITY_DESC, FIXString::from(v));
474    }
475
476    /// Gets `SecurityDesc`, Tag 107.
477    pub fn get_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
478        let mut fld = field::SecurityDescField::new(String::new());
479        self.message.body.get_field(tag::SECURITY_DESC, &mut fld.0)?;
480        Ok(fld.value().to_string())
481    }
482
483
484    /// Returns true if `SecurityDesc` is present, Tag 107.
485    pub fn has_security_desc(&self) -> bool {
486        self.message.body.has(tag::SECURITY_DESC)
487    }
488
489
490
491
492    /// Sets `SecurityExchange`, Tag 207.
493    pub fn set_security_exchange(&mut self, v: String) {
494        self.message.body.set_field(tag::SECURITY_EXCHANGE, FIXString::from(v));
495    }
496
497    /// Gets `SecurityExchange`, Tag 207.
498    pub fn get_security_exchange(&self) -> Result<String, MessageRejectErrorEnum> {
499        let mut fld = field::SecurityExchangeField::new(String::new());
500        self.message.body.get_field(tag::SECURITY_EXCHANGE, &mut fld.0)?;
501        Ok(fld.value().to_string())
502    }
503
504
505    /// Returns true if `SecurityExchange` is present, Tag 207.
506    pub fn has_security_exchange(&self) -> bool {
507        self.message.body.has(tag::SECURITY_EXCHANGE)
508    }
509
510
511
512
513    /// Sets `SecurityID`, Tag 48.
514    pub fn set_security_id(&mut self, v: String) {
515        self.message.body.set_field(tag::SECURITY_ID, FIXString::from(v));
516    }
517
518    /// Gets `SecurityID`, Tag 48.
519    pub fn get_security_id(&self) -> Result<String, MessageRejectErrorEnum> {
520        let mut fld = field::SecurityIDField::new(String::new());
521        self.message.body.get_field(tag::SECURITY_ID, &mut fld.0)?;
522        Ok(fld.value().to_string())
523    }
524
525
526    /// Returns true if `SecurityID` is present, Tag 48.
527    pub fn has_security_id(&self) -> bool {
528        self.message.body.has(tag::SECURITY_ID)
529    }
530
531
532
533
534    /// Sets `SecurityType`, Tag 167.
535    pub fn set_security_type(&mut self, v: String) {
536        self.message.body.set_field(tag::SECURITY_TYPE, FIXString::from(v));
537    }
538
539    /// Gets `SecurityType`, Tag 167.
540    pub fn get_security_type(&self) -> Result<String, MessageRejectErrorEnum> {
541        let mut fld = field::SecurityTypeField::new(String::new());
542        self.message.body.get_field(tag::SECURITY_TYPE, &mut fld.0)?;
543        Ok(fld.value().to_string())
544    }
545
546
547    /// Returns true if `SecurityType` is present, Tag 167.
548    pub fn has_security_type(&self) -> bool {
549        self.message.body.has(tag::SECURITY_TYPE)
550    }
551
552
553
554
555    /// Sets `StrikePrice`, Tag 202.
556    pub fn set_strike_price(&mut self, val: Decimal, scale: i32) {
557        self.message.body.set_field(tag::STRIKE_PRICE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
558    }
559
560    /// Gets `StrikePrice`, Tag 202.
561    pub fn get_strike_price(&self) -> Result<Decimal, MessageRejectErrorEnum> {
562        let mut fld = field::StrikePriceField::new(Decimal::ZERO, 0);
563        self.message.body.get_field(tag::STRIKE_PRICE, &mut fld.0)?;
564        Ok(fld.value())
565    }
566
567
568    /// Returns true if `StrikePrice` is present, Tag 202.
569    pub fn has_strike_price(&self) -> bool {
570        self.message.body.has(tag::STRIKE_PRICE)
571    }
572
573
574
575
576    /// Sets `Symbol`, Tag 55.
577    pub fn set_symbol(&mut self, v: String) {
578        self.message.body.set_field(tag::SYMBOL, FIXString::from(v));
579    }
580
581    /// Gets `Symbol`, Tag 55.
582    pub fn get_symbol(&self) -> Result<String, MessageRejectErrorEnum> {
583        let mut fld = field::SymbolField::new(String::new());
584        self.message.body.get_field(tag::SYMBOL, &mut fld.0)?;
585        Ok(fld.value().to_string())
586    }
587
588
589    /// Returns true if `Symbol` is present, Tag 55.
590    pub fn has_symbol(&self) -> bool {
591        self.message.body.has(tag::SYMBOL)
592    }
593
594
595
596
597    /// Sets `SymbolSfx`, Tag 65.
598    pub fn set_symbol_sfx(&mut self, v: String) {
599        self.message.body.set_field(tag::SYMBOL_SFX, FIXString::from(v));
600    }
601
602    /// Gets `SymbolSfx`, Tag 65.
603    pub fn get_symbol_sfx(&self) -> Result<String, MessageRejectErrorEnum> {
604        let mut fld = field::SymbolSfxField::new(String::new());
605        self.message.body.get_field(tag::SYMBOL_SFX, &mut fld.0)?;
606        Ok(fld.value().to_string())
607    }
608
609
610    /// Returns true if `SymbolSfx` is present, Tag 65.
611    pub fn has_symbol_sfx(&self) -> bool {
612        self.message.body.has(tag::SYMBOL_SFX)
613    }
614
615
616
617
618    /// Sets `TransactTime`, Tag 60.
619    pub fn set_transact_time(&mut self, v: Timestamp) {
620        self.message.body.set_field(tag::TRANSACT_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
621            time: v,
622            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
623        });
624    }
625
626    /// Gets `TransactTime`, Tag 60.
627    pub fn get_transact_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
628        let mut fld = field::TransactTimeField::new(Timestamp::UNIX_EPOCH);
629        self.message.body.get_field(tag::TRANSACT_TIME, &mut fld.0)?;
630        Ok(fld.value())
631    }
632
633
634    /// Returns true if `TransactTime` is present, Tag 60.
635    pub fn has_transact_time(&self) -> bool {
636        self.message.body.has(tag::TRANSACT_TIME)
637    }
638
639
640
641
642    /// Sets `ValidUntilTime`, Tag 62.
643    pub fn set_valid_until_time(&mut self, v: Timestamp) {
644        self.message.body.set_field(tag::VALID_UNTIL_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
645            time: v,
646            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
647        });
648    }
649
650    /// Gets `ValidUntilTime`, Tag 62.
651    pub fn get_valid_until_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
652        let mut fld = field::ValidUntilTimeField::new(Timestamp::UNIX_EPOCH);
653        self.message.body.get_field(tag::VALID_UNTIL_TIME, &mut fld.0)?;
654        Ok(fld.value())
655    }
656
657
658    /// Returns true if `ValidUntilTime` is present, Tag 62.
659    pub fn has_valid_until_time(&self) -> bool {
660        self.message.body.has(tag::VALID_UNTIL_TIME)
661    }
662
663
664}
665
666/// `RouteOut` is the callback type for routing `Quote` messages.
667pub type RouteOut = fn(msg: Quote, session_id: SessionID) -> Result<(), MessageRejectErrorEnum>;
668
669/// Route type returned by the `route` function.
670pub type Route = (&'static str, &'static str, Box<dyn Fn(&Message, SessionID) -> Result<(), MessageRejectErrorEnum> + Send>);
671
672/// Returns the begin string, message type, and route function for `Quote`.
673pub fn route(router: RouteOut) -> Route {
674    let r = move |msg: &Message, session_id: SessionID| -> Result<(), MessageRejectErrorEnum> {
675        router(Quote::from_message(msg.clone()), session_id)
676    };
677    ("FIX.4.1", "S", Box::new(r))
678}