refix_fix44/generated/components/
comp_id_stat_grp.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{GroupTable, InvalidValue, LazyKnownTags, Tag};
5
6use super::super::enums::StatusValue;
7
8#[derive(Clone, Copy)]
10pub struct CompIDStatGrp<'a>(refix_message::Scope<'a>);
11
12impl<'a> From<refix_message::Scope<'a>> for CompIDStatGrp<'a> {
13 fn from(scope: refix_message::Scope<'a>) -> Self {
14 Self(scope)
15 }
16}
17
18impl<'a> CompIDStatGrp<'a> {
19 pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
20 Tag(936),
21 Tag(930),
22 &[Tag(283), Tag(284), Tag(928), Tag(929), Tag(930), Tag(931)],
23 &[],
24 );
25
26 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
27 static TAGS: LazyKnownTags = LazyKnownTags::new(
28 &[Tag(930), Tag(931), Tag(283), Tag(284), Tag(928), Tag(929)],
29 &[],
30 );
31 &TAGS
32 }
33
34 pub fn raw(&self) -> refix_message::Scope<'a> {
35 self.0
36 }
37
38 #[doc(alias = "RefCompID")]
40 pub fn ref_comp_id(&self) -> Result<Option<&'a str>, InvalidValue> {
41 self.0.get_str(Tag(930))
42 }
43
44 #[doc(alias = "RefSubID")]
46 pub fn ref_sub_id(&self) -> Result<Option<&'a str>, InvalidValue> {
47 self.0.get_str(Tag(931))
48 }
49
50 #[doc(alias = "LocationID")]
52 pub fn location_id(&self) -> Result<Option<&'a str>, InvalidValue> {
53 self.0.get_str(Tag(283))
54 }
55
56 #[doc(alias = "DeskID")]
58 pub fn desk_id(&self) -> Result<Option<&'a str>, InvalidValue> {
59 self.0.get_str(Tag(284))
60 }
61
62 #[doc(alias = "StatusValue")]
64 pub fn status_value(&self) -> Result<Option<StatusValue>, InvalidValue> {
65 Ok(self.0.get_int(Tag(928))?.map(StatusValue::from_value))
66 }
67
68 #[doc(alias = "StatusText")]
70 pub fn status_text(&self) -> Result<Option<&'a str>, InvalidValue> {
71 self.0.get_str(Tag(929))
72 }
73}
74
75impl std::fmt::Debug for CompIDStatGrp<'_> {
76 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
77 write!(f, "CompIDStatGrp({})", self.0)
78 }
79}