Skip to main content

refix_fix44/generated/components/
spread_or_benchmark_curve_data.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Decimal, InvalidValue, LazyKnownTags, Tag};
5
6/// The fields of the `SpreadOrBenchmarkCurveData` component.
7#[derive(Clone, Copy)]
8pub struct SpreadOrBenchmarkCurveData<'a>(pub(in super::super) refix_message::Scope<'a>);
9
10impl<'a> SpreadOrBenchmarkCurveData<'a> {
11    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
12        static TAGS: LazyKnownTags = LazyKnownTags::new(
13            &[Tag(218), Tag(220), Tag(221), Tag(222), Tag(662), Tag(663), Tag(699), Tag(761)],
14            &[],
15        );
16        &TAGS
17    }
18
19    pub fn raw(&self) -> refix_message::Scope<'a> {
20        self.0
21    }
22
23    /// The `Spread` (218) field.
24    #[doc(alias = "Spread")]
25    pub fn spread(&self) -> Result<Option<Decimal>, InvalidValue> {
26        self.0.get_decimal(Tag(218))
27    }
28
29    /// The `BenchmarkCurveCurrency` (220) field.
30    #[doc(alias = "BenchmarkCurveCurrency")]
31    pub fn benchmark_curve_currency(&self) -> Result<Option<&'a str>, InvalidValue> {
32        self.0.get_str(Tag(220))
33    }
34
35    /// The `BenchmarkCurveName` (221) field.
36    #[doc(alias = "BenchmarkCurveName")]
37    pub fn benchmark_curve_name(&self) -> Result<Option<&'a str>, InvalidValue> {
38        self.0.get_str(Tag(221))
39    }
40
41    /// The `BenchmarkCurvePoint` (222) field.
42    #[doc(alias = "BenchmarkCurvePoint")]
43    pub fn benchmark_curve_point(&self) -> Result<Option<&'a str>, InvalidValue> {
44        self.0.get_str(Tag(222))
45    }
46
47    /// The `BenchmarkPrice` (662) field.
48    #[doc(alias = "BenchmarkPrice")]
49    pub fn benchmark_price(&self) -> Result<Option<Decimal>, InvalidValue> {
50        self.0.get_decimal(Tag(662))
51    }
52
53    /// The `BenchmarkPriceType` (663) field.
54    #[doc(alias = "BenchmarkPriceType")]
55    pub fn benchmark_price_type(&self) -> Result<Option<i64>, InvalidValue> {
56        self.0.get_int(Tag(663))
57    }
58
59    /// The `BenchmarkSecurityID` (699) field.
60    #[doc(alias = "BenchmarkSecurityID")]
61    pub fn benchmark_security_id(&self) -> Result<Option<&'a str>, InvalidValue> {
62        self.0.get_str(Tag(699))
63    }
64
65    /// The `BenchmarkSecurityIDSource` (761) field.
66    #[doc(alias = "BenchmarkSecurityIDSource")]
67    pub fn benchmark_security_id_source(&self) -> Result<Option<&'a str>, InvalidValue> {
68        self.0.get_str(Tag(761))
69    }
70}
71
72impl std::fmt::Debug for SpreadOrBenchmarkCurveData<'_> {
73    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
74        write!(f, "SpreadOrBenchmarkCurveData({})", self.0.display_known(&Self::known_tags().get()))
75    }
76}