refix_fix44/generated/components/
exec_alloc_grp.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Decimal, GroupTable, InvalidValue, LazyKnownTags, Tag};
5
6use super::super::enums::LastCapacity;
7
8#[derive(Clone, Copy)]
10pub struct ExecAllocGrp<'a>(refix_message::Scope<'a>);
11
12impl<'a> From<refix_message::Scope<'a>> for ExecAllocGrp<'a> {
13 fn from(scope: refix_message::Scope<'a>) -> Self {
14 Self(scope)
15 }
16}
17
18impl<'a> ExecAllocGrp<'a> {
19 pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
20 Tag(124),
21 Tag(32),
22 &[Tag(17), Tag(29), Tag(31), Tag(32), Tag(527), Tag(669)],
23 &[],
24 );
25
26 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
27 static TAGS: LazyKnownTags = LazyKnownTags::new(
28 &[Tag(32), Tag(17), Tag(527), Tag(31), Tag(669), Tag(29)],
29 &[],
30 );
31 &TAGS
32 }
33
34 pub fn raw(&self) -> refix_message::Scope<'a> {
35 self.0
36 }
37
38 #[doc(alias = "LastQty")]
40 pub fn last_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
41 self.0.get_decimal(Tag(32))
42 }
43
44 #[doc(alias = "ExecID")]
46 pub fn exec_id(&self) -> Result<Option<&'a str>, InvalidValue> {
47 self.0.get_str(Tag(17))
48 }
49
50 #[doc(alias = "SecondaryExecID")]
52 pub fn secondary_exec_id(&self) -> Result<Option<&'a str>, InvalidValue> {
53 self.0.get_str(Tag(527))
54 }
55
56 #[doc(alias = "LastPx")]
58 pub fn last_px(&self) -> Result<Option<Decimal>, InvalidValue> {
59 self.0.get_decimal(Tag(31))
60 }
61
62 #[doc(alias = "LastParPx")]
64 pub fn last_par_px(&self) -> Result<Option<Decimal>, InvalidValue> {
65 self.0.get_decimal(Tag(669))
66 }
67
68 #[doc(alias = "LastCapacity")]
70 pub fn last_capacity(&self) -> Result<Option<LastCapacity<'a>>, InvalidValue> {
71 Ok(self.0.get_str(Tag(29))?.map(LastCapacity::from_value))
72 }
73}
74
75impl std::fmt::Debug for ExecAllocGrp<'_> {
76 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
77 write!(f, "ExecAllocGrp({})", self.0)
78 }
79}