Skip to main content

refix_fix44/generated/components/
instrument_leg.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, Instances, InvalidValue, KnownTags, LazyKnownTags, MonthYear, Tag,
6};
7
8use super::LegSecAltIDGrp;
9
10/// The fields of the `InstrumentLeg` component.
11#[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    /// The `LegSymbol` (600) field.
38    #[doc(alias = "LegSymbol")]
39    pub fn leg_symbol(&self) -> Result<Option<&'a str>, InvalidValue> {
40        self.0.get_str(Tag(600))
41    }
42
43    /// The `LegSymbolSfx` (601) field.
44    #[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    /// The `LegSecurityID` (602) field.
50    #[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    /// The `LegSecurityIDSource` (603) field.
56    #[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    /// The instances of the `NoLegSecurityAltID` (604) group.
62    #[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    /// The `LegProduct` (607) field.
68    #[doc(alias = "LegProduct")]
69    pub fn leg_product(&self) -> Result<Option<i64>, InvalidValue> {
70        self.0.get_int(Tag(607))
71    }
72
73    /// The `LegCFICode` (608) field.
74    #[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    /// The `LegSecurityType` (609) field.
80    #[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    /// The `LegSecuritySubType` (764) field.
86    #[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    /// The `LegMaturityMonthYear` (610) field.
92    #[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    /// The `LegMaturityDate` (611) field.
98    #[doc(alias = "LegMaturityDate")]
99    pub fn leg_maturity_date(&self) -> Result<Option<Date>, InvalidValue> {
100        self.0.get_date(Tag(611))
101    }
102
103    /// The `LegCouponPaymentDate` (248) field.
104    #[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    /// The `LegIssueDate` (249) field.
110    #[doc(alias = "LegIssueDate")]
111    pub fn leg_issue_date(&self) -> Result<Option<Date>, InvalidValue> {
112        self.0.get_date(Tag(249))
113    }
114
115    /// The `LegRepoCollateralSecurityType` (250) field.
116    #[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    /// The `LegRepurchaseTerm` (251) field.
122    #[doc(alias = "LegRepurchaseTerm")]
123    pub fn leg_repurchase_term(&self) -> Result<Option<i64>, InvalidValue> {
124        self.0.get_int(Tag(251))
125    }
126
127    /// The `LegRepurchaseRate` (252) field.
128    #[doc(alias = "LegRepurchaseRate")]
129    pub fn leg_repurchase_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
130        self.0.get_decimal(Tag(252))
131    }
132
133    /// The `LegFactor` (253) field.
134    #[doc(alias = "LegFactor")]
135    pub fn leg_factor(&self) -> Result<Option<Decimal>, InvalidValue> {
136        self.0.get_decimal(Tag(253))
137    }
138
139    /// The `LegCreditRating` (257) field.
140    #[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    /// The `LegInstrRegistry` (599) field.
146    #[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    /// The `LegCountryOfIssue` (596) field.
152    #[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    /// The `LegStateOrProvinceOfIssue` (597) field.
158    #[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    /// The `LegLocaleOfIssue` (598) field.
164    #[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    /// The `LegRedemptionDate` (254) field.
170    #[doc(alias = "LegRedemptionDate")]
171    pub fn leg_redemption_date(&self) -> Result<Option<Date>, InvalidValue> {
172        self.0.get_date(Tag(254))
173    }
174
175    /// The `LegStrikePrice` (612) field.
176    #[doc(alias = "LegStrikePrice")]
177    pub fn leg_strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
178        self.0.get_decimal(Tag(612))
179    }
180
181    /// The `LegStrikeCurrency` (942) field.
182    #[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    /// The `LegOptAttribute` (613) field.
188    #[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    /// The `LegContractMultiplier` (614) field.
194    #[doc(alias = "LegContractMultiplier")]
195    pub fn leg_contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
196        self.0.get_decimal(Tag(614))
197    }
198
199    /// The `LegCouponRate` (615) field.
200    #[doc(alias = "LegCouponRate")]
201    pub fn leg_coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
202        self.0.get_decimal(Tag(615))
203    }
204
205    /// The `LegSecurityExchange` (616) field.
206    #[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    /// The `LegIssuer` (617) field.
212    #[doc(alias = "LegIssuer")]
213    pub fn leg_issuer(&self) -> Result<Option<&'a str>, InvalidValue> {
214        self.0.get_str(Tag(617))
215    }
216
217    /// The `EncodedLegIssuerLen` (618) field.
218    #[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    /// The `EncodedLegIssuer` (619) field.
224    #[doc(alias = "EncodedLegIssuer")]
225    pub fn encoded_leg_issuer(&self) -> Option<&'a [u8]> {
226        self.0.get(Tag(619))
227    }
228
229    /// The `LegSecurityDesc` (620) field.
230    #[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    /// The `EncodedLegSecurityDescLen` (621) field.
236    #[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    /// The `EncodedLegSecurityDesc` (622) field.
242    #[doc(alias = "EncodedLegSecurityDesc")]
243    pub fn encoded_leg_security_desc(&self) -> Option<&'a [u8]> {
244        self.0.get(Tag(622))
245    }
246
247    /// The `LegRatioQty` (623) field.
248    #[doc(alias = "LegRatioQty")]
249    pub fn leg_ratio_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
250        self.0.get_decimal(Tag(623))
251    }
252
253    /// The `LegSide` (624) field.
254    #[doc(alias = "LegSide")]
255    pub fn leg_side(&self) -> Result<Option<&'a str>, InvalidValue> {
256        self.0.get_str(Tag(624))
257    }
258
259    /// The `LegCurrency` (556) field.
260    #[doc(alias = "LegCurrency")]
261    pub fn leg_currency(&self) -> Result<Option<&'a str>, InvalidValue> {
262        self.0.get_str(Tag(556))
263    }
264
265    /// The `LegPool` (740) field.
266    #[doc(alias = "LegPool")]
267    pub fn leg_pool(&self) -> Result<Option<&'a str>, InvalidValue> {
268        self.0.get_str(Tag(740))
269    }
270
271    /// The `LegDatedDate` (739) field.
272    #[doc(alias = "LegDatedDate")]
273    pub fn leg_dated_date(&self) -> Result<Option<Date>, InvalidValue> {
274        self.0.get_date(Tag(739))
275    }
276
277    /// The `LegContractSettlMonth` (955) field.
278    #[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    /// The `LegInterestAccrualDate` (956) field.
284    #[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}