refix_fix44/generated/components/
quot_entry_grp.rs1#![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#[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 #[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 pub fn instrument(&self) -> Instrument<'a> {
64 Instrument(self.0, Self::known_tags().get())
65 }
66
67 #[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 #[doc(alias = "BidPx")]
75 pub fn bid_px(&self) -> Result<Option<Decimal>, InvalidValue> {
76 self.0.get_decimal(Tag(132))
77 }
78
79 #[doc(alias = "OfferPx")]
81 pub fn offer_px(&self) -> Result<Option<Decimal>, InvalidValue> {
82 self.0.get_decimal(Tag(133))
83 }
84
85 #[doc(alias = "BidSize")]
87 pub fn bid_size(&self) -> Result<Option<Decimal>, InvalidValue> {
88 self.0.get_decimal(Tag(134))
89 }
90
91 #[doc(alias = "OfferSize")]
93 pub fn offer_size(&self) -> Result<Option<Decimal>, InvalidValue> {
94 self.0.get_decimal(Tag(135))
95 }
96
97 #[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 #[doc(alias = "BidSpotRate")]
105 pub fn bid_spot_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
106 self.0.get_decimal(Tag(188))
107 }
108
109 #[doc(alias = "OfferSpotRate")]
111 pub fn offer_spot_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
112 self.0.get_decimal(Tag(190))
113 }
114
115 #[doc(alias = "BidForwardPoints")]
117 pub fn bid_forward_points(&self) -> Result<Option<Decimal>, InvalidValue> {
118 self.0.get_decimal(Tag(189))
119 }
120
121 #[doc(alias = "OfferForwardPoints")]
123 pub fn offer_forward_points(&self) -> Result<Option<Decimal>, InvalidValue> {
124 self.0.get_decimal(Tag(191))
125 }
126
127 #[doc(alias = "MidPx")]
129 pub fn mid_px(&self) -> Result<Option<Decimal>, InvalidValue> {
130 self.0.get_decimal(Tag(631))
131 }
132
133 #[doc(alias = "BidYield")]
135 pub fn bid_yield(&self) -> Result<Option<Decimal>, InvalidValue> {
136 self.0.get_decimal(Tag(632))
137 }
138
139 #[doc(alias = "MidYield")]
141 pub fn mid_yield(&self) -> Result<Option<Decimal>, InvalidValue> {
142 self.0.get_decimal(Tag(633))
143 }
144
145 #[doc(alias = "OfferYield")]
147 pub fn offer_yield(&self) -> Result<Option<Decimal>, InvalidValue> {
148 self.0.get_decimal(Tag(634))
149 }
150
151 #[doc(alias = "TransactTime")]
153 pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
154 self.0.get_utc_timestamp(Tag(60))
155 }
156
157 #[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 #[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 #[doc(alias = "SettlDate")]
171 pub fn settl_date(&self) -> Result<Option<Date>, InvalidValue> {
172 self.0.get_date(Tag(64))
173 }
174
175 #[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 #[doc(alias = "SettlDate2")]
183 pub fn settl_date2(&self) -> Result<Option<Date>, InvalidValue> {
184 self.0.get_date(Tag(193))
185 }
186
187 #[doc(alias = "OrderQty2")]
189 pub fn order_qty2(&self) -> Result<Option<Decimal>, InvalidValue> {
190 self.0.get_decimal(Tag(192))
191 }
192
193 #[doc(alias = "BidForwardPoints2")]
195 pub fn bid_forward_points2(&self) -> Result<Option<Decimal>, InvalidValue> {
196 self.0.get_decimal(Tag(642))
197 }
198
199 #[doc(alias = "OfferForwardPoints2")]
201 pub fn offer_forward_points2(&self) -> Result<Option<Decimal>, InvalidValue> {
202 self.0.get_decimal(Tag(643))
203 }
204
205 #[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}