refix_fix44/generated/components/
instrument_leg.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{
5 Date, Decimal, Instances, InvalidValue, KnownTags, LazyKnownTags, MonthYear, Tag,
6};
7
8use super::LegSecAltIDGrp;
9
10#[derive(Clone, Copy)]
12pub struct InstrumentLeg<'a>(
13 pub(in super::super) refix_message::Scope<'a>,
14 pub(in super::super) KnownTags<'static>,
15);
16
17impl<'a> InstrumentLeg<'a> {
18 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
19 static TAGS: LazyKnownTags = LazyKnownTags::new(
20 &[
21 Tag(600), Tag(601), Tag(602), Tag(603), Tag(604), Tag(607), Tag(608), Tag(609),
22 Tag(764), Tag(610), Tag(611), Tag(248), Tag(249), Tag(250), Tag(251), Tag(252),
23 Tag(253), Tag(257), Tag(599), Tag(596), Tag(597), Tag(598), Tag(254), Tag(612),
24 Tag(942), Tag(613), Tag(614), Tag(615), Tag(616), Tag(617), Tag(618), Tag(619),
25 Tag(620), Tag(621), Tag(622), Tag(623), Tag(624), Tag(556), Tag(740), Tag(739),
26 Tag(955), Tag(956),
27 ],
28 &[LegSecAltIDGrp::known_tags()],
29 );
30 &TAGS
31 }
32
33 pub fn raw(&self) -> refix_message::Scope<'a> {
34 self.0
35 }
36
37 #[doc(alias = "LegSymbol")]
39 pub fn leg_symbol(&self) -> Result<Option<&'a str>, InvalidValue> {
40 self.0.get_str(Tag(600))
41 }
42
43 #[doc(alias = "LegSymbolSfx")]
45 pub fn leg_symbol_sfx(&self) -> Result<Option<&'a str>, InvalidValue> {
46 self.0.get_str(Tag(601))
47 }
48
49 #[doc(alias = "LegSecurityID")]
51 pub fn leg_security_id(&self) -> Result<Option<&'a str>, InvalidValue> {
52 self.0.get_str(Tag(602))
53 }
54
55 #[doc(alias = "LegSecurityIDSource")]
57 pub fn leg_security_id_source(&self) -> Result<Option<&'a str>, InvalidValue> {
58 self.0.get_str(Tag(603))
59 }
60
61 #[doc(alias = "NoLegSecurityAltID")]
63 pub fn leg_security_alt_id(&self) -> Result<Instances<'a, LegSecAltIDGrp<'a>>, InvalidValue> {
64 self.0.get_group(&LegSecAltIDGrp::TABLE, &self.1).map(Instances::from)
65 }
66
67 #[doc(alias = "LegProduct")]
69 pub fn leg_product(&self) -> Result<Option<i64>, InvalidValue> {
70 self.0.get_int(Tag(607))
71 }
72
73 #[doc(alias = "LegCFICode")]
75 pub fn leg_cfi_code(&self) -> Result<Option<&'a str>, InvalidValue> {
76 self.0.get_str(Tag(608))
77 }
78
79 #[doc(alias = "LegSecurityType")]
81 pub fn leg_security_type(&self) -> Result<Option<&'a str>, InvalidValue> {
82 self.0.get_str(Tag(609))
83 }
84
85 #[doc(alias = "LegSecuritySubType")]
87 pub fn leg_security_sub_type(&self) -> Result<Option<&'a str>, InvalidValue> {
88 self.0.get_str(Tag(764))
89 }
90
91 #[doc(alias = "LegMaturityMonthYear")]
93 pub fn leg_maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
94 self.0.get_month_year(Tag(610))
95 }
96
97 #[doc(alias = "LegMaturityDate")]
99 pub fn leg_maturity_date(&self) -> Result<Option<Date>, InvalidValue> {
100 self.0.get_date(Tag(611))
101 }
102
103 #[doc(alias = "LegCouponPaymentDate")]
105 pub fn leg_coupon_payment_date(&self) -> Result<Option<Date>, InvalidValue> {
106 self.0.get_date(Tag(248))
107 }
108
109 #[doc(alias = "LegIssueDate")]
111 pub fn leg_issue_date(&self) -> Result<Option<Date>, InvalidValue> {
112 self.0.get_date(Tag(249))
113 }
114
115 #[doc(alias = "LegRepoCollateralSecurityType")]
117 pub fn leg_repo_collateral_security_type(&self) -> Result<Option<&'a str>, InvalidValue> {
118 self.0.get_str(Tag(250))
119 }
120
121 #[doc(alias = "LegRepurchaseTerm")]
123 pub fn leg_repurchase_term(&self) -> Result<Option<i64>, InvalidValue> {
124 self.0.get_int(Tag(251))
125 }
126
127 #[doc(alias = "LegRepurchaseRate")]
129 pub fn leg_repurchase_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
130 self.0.get_decimal(Tag(252))
131 }
132
133 #[doc(alias = "LegFactor")]
135 pub fn leg_factor(&self) -> Result<Option<Decimal>, InvalidValue> {
136 self.0.get_decimal(Tag(253))
137 }
138
139 #[doc(alias = "LegCreditRating")]
141 pub fn leg_credit_rating(&self) -> Result<Option<&'a str>, InvalidValue> {
142 self.0.get_str(Tag(257))
143 }
144
145 #[doc(alias = "LegInstrRegistry")]
147 pub fn leg_instr_registry(&self) -> Result<Option<&'a str>, InvalidValue> {
148 self.0.get_str(Tag(599))
149 }
150
151 #[doc(alias = "LegCountryOfIssue")]
153 pub fn leg_country_of_issue(&self) -> Result<Option<&'a str>, InvalidValue> {
154 self.0.get_str(Tag(596))
155 }
156
157 #[doc(alias = "LegStateOrProvinceOfIssue")]
159 pub fn leg_state_or_province_of_issue(&self) -> Result<Option<&'a str>, InvalidValue> {
160 self.0.get_str(Tag(597))
161 }
162
163 #[doc(alias = "LegLocaleOfIssue")]
165 pub fn leg_locale_of_issue(&self) -> Result<Option<&'a str>, InvalidValue> {
166 self.0.get_str(Tag(598))
167 }
168
169 #[doc(alias = "LegRedemptionDate")]
171 pub fn leg_redemption_date(&self) -> Result<Option<Date>, InvalidValue> {
172 self.0.get_date(Tag(254))
173 }
174
175 #[doc(alias = "LegStrikePrice")]
177 pub fn leg_strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
178 self.0.get_decimal(Tag(612))
179 }
180
181 #[doc(alias = "LegStrikeCurrency")]
183 pub fn leg_strike_currency(&self) -> Result<Option<&'a str>, InvalidValue> {
184 self.0.get_str(Tag(942))
185 }
186
187 #[doc(alias = "LegOptAttribute")]
189 pub fn leg_opt_attribute(&self) -> Result<Option<&'a str>, InvalidValue> {
190 self.0.get_str(Tag(613))
191 }
192
193 #[doc(alias = "LegContractMultiplier")]
195 pub fn leg_contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
196 self.0.get_decimal(Tag(614))
197 }
198
199 #[doc(alias = "LegCouponRate")]
201 pub fn leg_coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
202 self.0.get_decimal(Tag(615))
203 }
204
205 #[doc(alias = "LegSecurityExchange")]
207 pub fn leg_security_exchange(&self) -> Result<Option<&'a str>, InvalidValue> {
208 self.0.get_str(Tag(616))
209 }
210
211 #[doc(alias = "LegIssuer")]
213 pub fn leg_issuer(&self) -> Result<Option<&'a str>, InvalidValue> {
214 self.0.get_str(Tag(617))
215 }
216
217 #[doc(alias = "EncodedLegIssuerLen")]
219 pub fn encoded_leg_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
220 self.0.get_int(Tag(618))
221 }
222
223 #[doc(alias = "EncodedLegIssuer")]
225 pub fn encoded_leg_issuer(&self) -> Option<&'a [u8]> {
226 self.0.get(Tag(619))
227 }
228
229 #[doc(alias = "LegSecurityDesc")]
231 pub fn leg_security_desc(&self) -> Result<Option<&'a str>, InvalidValue> {
232 self.0.get_str(Tag(620))
233 }
234
235 #[doc(alias = "EncodedLegSecurityDescLen")]
237 pub fn encoded_leg_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
238 self.0.get_int(Tag(621))
239 }
240
241 #[doc(alias = "EncodedLegSecurityDesc")]
243 pub fn encoded_leg_security_desc(&self) -> Option<&'a [u8]> {
244 self.0.get(Tag(622))
245 }
246
247 #[doc(alias = "LegRatioQty")]
249 pub fn leg_ratio_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
250 self.0.get_decimal(Tag(623))
251 }
252
253 #[doc(alias = "LegSide")]
255 pub fn leg_side(&self) -> Result<Option<&'a str>, InvalidValue> {
256 self.0.get_str(Tag(624))
257 }
258
259 #[doc(alias = "LegCurrency")]
261 pub fn leg_currency(&self) -> Result<Option<&'a str>, InvalidValue> {
262 self.0.get_str(Tag(556))
263 }
264
265 #[doc(alias = "LegPool")]
267 pub fn leg_pool(&self) -> Result<Option<&'a str>, InvalidValue> {
268 self.0.get_str(Tag(740))
269 }
270
271 #[doc(alias = "LegDatedDate")]
273 pub fn leg_dated_date(&self) -> Result<Option<Date>, InvalidValue> {
274 self.0.get_date(Tag(739))
275 }
276
277 #[doc(alias = "LegContractSettlMonth")]
279 pub fn leg_contract_settl_month(&self) -> Result<Option<MonthYear>, InvalidValue> {
280 self.0.get_month_year(Tag(955))
281 }
282
283 #[doc(alias = "LegInterestAccrualDate")]
285 pub fn leg_interest_accrual_date(&self) -> Result<Option<Date>, InvalidValue> {
286 self.0.get_date(Tag(956))
287 }
288}
289
290impl std::fmt::Debug for InstrumentLeg<'_> {
291 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
292 write!(f, "InstrumentLeg({})", self.0.display_known(&Self::known_tags().get()))
293 }
294}