Skip to main content

refix_fix44/generated/components/
quot_entry_grp.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{
5    Date, Decimal, GroupTable, Instances, InvalidValue, LazyKnownTags, Tag, UtcTimestamp,
6};
7
8use super::super::enums::OrdType;
9use super::{EvntGrp, InstrmtLegGrp, Instrument, SecAltIDGrp};
10
11/// An instance of the `NoQuoteEntries` (295) group.
12#[derive(Clone, Copy)]
13pub struct QuotEntryGrp<'a>(refix_message::Scope<'a>);
14
15impl<'a> From<refix_message::Scope<'a>> for QuotEntryGrp<'a> {
16    fn from(scope: refix_message::Scope<'a>) -> Self {
17        Self(scope)
18    }
19}
20
21impl<'a> QuotEntryGrp<'a> {
22    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
23        Tag(295),
24        Tag(299),
25        &[
26            Tag(15), Tag(22), Tag(40), Tag(48), Tag(55), Tag(60), Tag(62), Tag(64), Tag(65),
27            Tag(106), Tag(107), Tag(132), Tag(133), Tag(134), Tag(135), Tag(167), Tag(188),
28            Tag(189), Tag(190), Tag(191), Tag(192), Tag(193), Tag(200), Tag(201), Tag(202),
29            Tag(206), Tag(207), Tag(223), Tag(224), Tag(225), Tag(226), Tag(227), Tag(228),
30            Tag(231), Tag(239), Tag(240), Tag(255), Tag(299), Tag(336), Tag(348), Tag(349),
31            Tag(350), Tag(351), Tag(454), Tag(460), Tag(461), Tag(470), Tag(471), Tag(472),
32            Tag(541), Tag(543), Tag(555), Tag(625), Tag(631), Tag(632), Tag(633), Tag(634),
33            Tag(642), Tag(643), Tag(667), Tag(691), Tag(762), Tag(864), Tag(873), Tag(874),
34            Tag(875), Tag(876), Tag(947),
35        ],
36        &[SecAltIDGrp::TABLE, EvntGrp::TABLE, InstrmtLegGrp::TABLE],
37    );
38
39    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
40        static TAGS: LazyKnownTags = LazyKnownTags::new(
41            &[
42                Tag(299), Tag(555), Tag(132), Tag(133), Tag(134), Tag(135), Tag(62), Tag(188),
43                Tag(190), Tag(189), Tag(191), Tag(631), Tag(632), Tag(633), Tag(634), Tag(60),
44                Tag(336), Tag(625), Tag(64), Tag(40), Tag(193), Tag(192), Tag(642), Tag(643),
45                Tag(15),
46            ],
47            &[Instrument::known_tags(), InstrmtLegGrp::known_tags()],
48        );
49        &TAGS
50    }
51
52    pub fn raw(&self) -> refix_message::Scope<'a> {
53        self.0
54    }
55
56    /// The `QuoteEntryID` (299) field.
57    #[doc(alias = "QuoteEntryID")]
58    pub fn quote_entry_id(&self) -> Result<Option<&'a str>, InvalidValue> {
59        self.0.get_str(Tag(299))
60    }
61
62    /// The `Instrument` component.
63    pub fn instrument(&self) -> Instrument<'a> {
64        Instrument(self.0, Self::known_tags().get())
65    }
66
67    /// The instances of the `NoLegs` (555) group.
68    #[doc(alias = "NoLegs")]
69    pub fn legs(&self) -> Result<Instances<'a, InstrmtLegGrp<'a>>, InvalidValue> {
70        self.0.get_group(&InstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
71    }
72
73    /// The `BidPx` (132) field.
74    #[doc(alias = "BidPx")]
75    pub fn bid_px(&self) -> Result<Option<Decimal>, InvalidValue> {
76        self.0.get_decimal(Tag(132))
77    }
78
79    /// The `OfferPx` (133) field.
80    #[doc(alias = "OfferPx")]
81    pub fn offer_px(&self) -> Result<Option<Decimal>, InvalidValue> {
82        self.0.get_decimal(Tag(133))
83    }
84
85    /// The `BidSize` (134) field.
86    #[doc(alias = "BidSize")]
87    pub fn bid_size(&self) -> Result<Option<Decimal>, InvalidValue> {
88        self.0.get_decimal(Tag(134))
89    }
90
91    /// The `OfferSize` (135) field.
92    #[doc(alias = "OfferSize")]
93    pub fn offer_size(&self) -> Result<Option<Decimal>, InvalidValue> {
94        self.0.get_decimal(Tag(135))
95    }
96
97    /// The `ValidUntilTime` (62) field.
98    #[doc(alias = "ValidUntilTime")]
99    pub fn valid_until_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
100        self.0.get_utc_timestamp(Tag(62))
101    }
102
103    /// The `BidSpotRate` (188) field.
104    #[doc(alias = "BidSpotRate")]
105    pub fn bid_spot_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
106        self.0.get_decimal(Tag(188))
107    }
108
109    /// The `OfferSpotRate` (190) field.
110    #[doc(alias = "OfferSpotRate")]
111    pub fn offer_spot_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
112        self.0.get_decimal(Tag(190))
113    }
114
115    /// The `BidForwardPoints` (189) field.
116    #[doc(alias = "BidForwardPoints")]
117    pub fn bid_forward_points(&self) -> Result<Option<Decimal>, InvalidValue> {
118        self.0.get_decimal(Tag(189))
119    }
120
121    /// The `OfferForwardPoints` (191) field.
122    #[doc(alias = "OfferForwardPoints")]
123    pub fn offer_forward_points(&self) -> Result<Option<Decimal>, InvalidValue> {
124        self.0.get_decimal(Tag(191))
125    }
126
127    /// The `MidPx` (631) field.
128    #[doc(alias = "MidPx")]
129    pub fn mid_px(&self) -> Result<Option<Decimal>, InvalidValue> {
130        self.0.get_decimal(Tag(631))
131    }
132
133    /// The `BidYield` (632) field.
134    #[doc(alias = "BidYield")]
135    pub fn bid_yield(&self) -> Result<Option<Decimal>, InvalidValue> {
136        self.0.get_decimal(Tag(632))
137    }
138
139    /// The `MidYield` (633) field.
140    #[doc(alias = "MidYield")]
141    pub fn mid_yield(&self) -> Result<Option<Decimal>, InvalidValue> {
142        self.0.get_decimal(Tag(633))
143    }
144
145    /// The `OfferYield` (634) field.
146    #[doc(alias = "OfferYield")]
147    pub fn offer_yield(&self) -> Result<Option<Decimal>, InvalidValue> {
148        self.0.get_decimal(Tag(634))
149    }
150
151    /// The `TransactTime` (60) field.
152    #[doc(alias = "TransactTime")]
153    pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
154        self.0.get_utc_timestamp(Tag(60))
155    }
156
157    /// The `TradingSessionID` (336) field.
158    #[doc(alias = "TradingSessionID")]
159    pub fn trading_session_id(&self) -> Result<Option<&'a str>, InvalidValue> {
160        self.0.get_str(Tag(336))
161    }
162
163    /// The `TradingSessionSubID` (625) field.
164    #[doc(alias = "TradingSessionSubID")]
165    pub fn trading_session_sub_id(&self) -> Result<Option<&'a str>, InvalidValue> {
166        self.0.get_str(Tag(625))
167    }
168
169    /// The `SettlDate` (64) field.
170    #[doc(alias = "SettlDate")]
171    pub fn settl_date(&self) -> Result<Option<Date>, InvalidValue> {
172        self.0.get_date(Tag(64))
173    }
174
175    /// The `OrdType` (40) field.
176    #[doc(alias = "OrdType")]
177    pub fn ord_type(&self) -> Result<Option<OrdType<'a>>, InvalidValue> {
178        Ok(self.0.get_str(Tag(40))?.map(OrdType::from_value))
179    }
180
181    /// The `SettlDate2` (193) field.
182    #[doc(alias = "SettlDate2")]
183    pub fn settl_date2(&self) -> Result<Option<Date>, InvalidValue> {
184        self.0.get_date(Tag(193))
185    }
186
187    /// The `OrderQty2` (192) field.
188    #[doc(alias = "OrderQty2")]
189    pub fn order_qty2(&self) -> Result<Option<Decimal>, InvalidValue> {
190        self.0.get_decimal(Tag(192))
191    }
192
193    /// The `BidForwardPoints2` (642) field.
194    #[doc(alias = "BidForwardPoints2")]
195    pub fn bid_forward_points2(&self) -> Result<Option<Decimal>, InvalidValue> {
196        self.0.get_decimal(Tag(642))
197    }
198
199    /// The `OfferForwardPoints2` (643) field.
200    #[doc(alias = "OfferForwardPoints2")]
201    pub fn offer_forward_points2(&self) -> Result<Option<Decimal>, InvalidValue> {
202        self.0.get_decimal(Tag(643))
203    }
204
205    /// The `Currency` (15) field.
206    #[doc(alias = "Currency")]
207    pub fn currency(&self) -> Result<Option<&'a str>, InvalidValue> {
208        self.0.get_str(Tag(15))
209    }
210}
211
212impl std::fmt::Debug for QuotEntryGrp<'_> {
213    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
214        write!(f, "QuotEntryGrp({})", self.0)
215    }
216}