Skip to main content

refix_fix44/generated/components/
pos_und_instrmt_grp.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Decimal, GroupTable, InvalidValue, LazyKnownTags, Tag};
5
6use super::{UndSecAltIDGrp, UnderlyingInstrument, UnderlyingStipulations};
7
8/// An instance of the `NoUnderlyings` (711) group.
9#[derive(Clone, Copy)]
10pub struct PosUndInstrmtGrp<'a>(refix_message::Scope<'a>);
11
12impl<'a> From<refix_message::Scope<'a>> for PosUndInstrmtGrp<'a> {
13    fn from(scope: refix_message::Scope<'a>) -> Self {
14        Self(scope)
15    }
16}
17
18impl<'a> PosUndInstrmtGrp<'a> {
19    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
20        Tag(711),
21        Tag(311),
22        &[
23            Tag(241), Tag(242), Tag(243), Tag(244), Tag(245), Tag(246), Tag(247), Tag(256),
24            Tag(305), Tag(306), Tag(307), Tag(308), Tag(309), Tag(310), Tag(311), Tag(312),
25            Tag(313), Tag(315), Tag(316), Tag(317), Tag(318), Tag(362), Tag(363), Tag(364),
26            Tag(365), Tag(435), Tag(436), Tag(457), Tag(462), Tag(463), Tag(542), Tag(592),
27            Tag(593), Tag(594), Tag(595), Tag(732), Tag(733), Tag(763), Tag(810), Tag(877),
28            Tag(878), Tag(879), Tag(882), Tag(883), Tag(884), Tag(885), Tag(886), Tag(887),
29            Tag(941),
30        ],
31        &[UndSecAltIDGrp::TABLE, UnderlyingStipulations::TABLE],
32    );
33
34    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
35        static TAGS: LazyKnownTags = LazyKnownTags::new(
36            &[Tag(732), Tag(733)],
37            &[UnderlyingInstrument::known_tags()],
38        );
39        &TAGS
40    }
41
42    pub fn raw(&self) -> refix_message::Scope<'a> {
43        self.0
44    }
45
46    /// The `UnderlyingInstrument` component.
47    pub fn underlying_instrument(&self) -> UnderlyingInstrument<'a> {
48        UnderlyingInstrument(self.0, Self::known_tags().get())
49    }
50
51    /// The `UnderlyingSettlPrice` (732) field.
52    #[doc(alias = "UnderlyingSettlPrice")]
53    pub fn underlying_settl_price(&self) -> Result<Option<Decimal>, InvalidValue> {
54        self.0.get_decimal(Tag(732))
55    }
56
57    /// The `UnderlyingSettlPriceType` (733) field.
58    #[doc(alias = "UnderlyingSettlPriceType")]
59    pub fn underlying_settl_price_type(&self) -> Result<Option<i64>, InvalidValue> {
60        self.0.get_int(Tag(733))
61    }
62}
63
64impl std::fmt::Debug for PosUndInstrmtGrp<'_> {
65    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
66        write!(f, "PosUndInstrmtGrp({})", self.0)
67    }
68}