refix_fix44/generated/components/
und_instrmt_coll_grp.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{GroupTable, InvalidValue, LazyKnownTags, Tag};
5
6use super::super::enums::CollAction;
7use super::{UndSecAltIDGrp, UnderlyingInstrument, UnderlyingStipulations};
8
9#[derive(Clone, Copy)]
11pub struct UndInstrmtCollGrp<'a>(refix_message::Scope<'a>);
12
13impl<'a> From<refix_message::Scope<'a>> for UndInstrmtCollGrp<'a> {
14 fn from(scope: refix_message::Scope<'a>) -> Self {
15 Self(scope)
16 }
17}
18
19impl<'a> UndInstrmtCollGrp<'a> {
20 pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
21 Tag(711),
22 Tag(311),
23 &[
24 Tag(241), Tag(242), Tag(243), Tag(244), Tag(245), Tag(246), Tag(247), Tag(256),
25 Tag(305), Tag(306), Tag(307), Tag(308), Tag(309), Tag(310), Tag(311), Tag(312),
26 Tag(313), Tag(315), Tag(316), Tag(317), Tag(318), Tag(362), Tag(363), Tag(364),
27 Tag(365), Tag(435), Tag(436), Tag(457), Tag(462), Tag(463), Tag(542), Tag(592),
28 Tag(593), Tag(594), Tag(595), Tag(763), Tag(810), Tag(877), Tag(878), Tag(879),
29 Tag(882), Tag(883), Tag(884), Tag(885), Tag(886), Tag(887), Tag(941), Tag(944),
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(944)],
37 &[UnderlyingInstrument::known_tags()],
38 );
39 &TAGS
40 }
41
42 pub fn raw(&self) -> refix_message::Scope<'a> {
43 self.0
44 }
45
46 pub fn underlying_instrument(&self) -> UnderlyingInstrument<'a> {
48 UnderlyingInstrument(self.0, Self::known_tags().get())
49 }
50
51 #[doc(alias = "CollAction")]
53 pub fn coll_action(&self) -> Result<Option<CollAction>, InvalidValue> {
54 Ok(self.0.get_int(Tag(944))?.map(CollAction::from_value))
55 }
56}
57
58impl std::fmt::Debug for UndInstrmtCollGrp<'_> {
59 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
60 write!(f, "UndInstrmtCollGrp({})", self.0)
61 }
62}