Skip to main content

refix_fix44/generated/components/
contra_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, UtcTimestamp};
5
6/// An instance of the `NoContraBrokers` (382) group.
7#[derive(Clone, Copy)]
8pub struct ContraGrp<'a>(refix_message::Scope<'a>);
9
10impl<'a> From<refix_message::Scope<'a>> for ContraGrp<'a> {
11    fn from(scope: refix_message::Scope<'a>) -> Self {
12        Self(scope)
13    }
14}
15
16impl<'a> ContraGrp<'a> {
17    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
18        Tag(382),
19        Tag(375),
20        &[Tag(337), Tag(375), Tag(437), Tag(438), Tag(655)],
21        &[],
22    );
23
24    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
25        static TAGS: LazyKnownTags = LazyKnownTags::new(
26            &[Tag(375), Tag(337), Tag(437), Tag(438), Tag(655)],
27            &[],
28        );
29        &TAGS
30    }
31
32    pub fn raw(&self) -> refix_message::Scope<'a> {
33        self.0
34    }
35
36    /// The `ContraBroker` (375) field.
37    #[doc(alias = "ContraBroker")]
38    pub fn contra_broker(&self) -> Result<Option<&'a str>, InvalidValue> {
39        self.0.get_str(Tag(375))
40    }
41
42    /// The `ContraTrader` (337) field.
43    #[doc(alias = "ContraTrader")]
44    pub fn contra_trader(&self) -> Result<Option<&'a str>, InvalidValue> {
45        self.0.get_str(Tag(337))
46    }
47
48    /// The `ContraTradeQty` (437) field.
49    #[doc(alias = "ContraTradeQty")]
50    pub fn contra_trade_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
51        self.0.get_decimal(Tag(437))
52    }
53
54    /// The `ContraTradeTime` (438) field.
55    #[doc(alias = "ContraTradeTime")]
56    pub fn contra_trade_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
57        self.0.get_utc_timestamp(Tag(438))
58    }
59
60    /// The `ContraLegRefID` (655) field.
61    #[doc(alias = "ContraLegRefID")]
62    pub fn contra_leg_ref_id(&self) -> Result<Option<&'a str>, InvalidValue> {
63        self.0.get_str(Tag(655))
64    }
65}
66
67impl std::fmt::Debug for ContraGrp<'_> {
68    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
69        write!(f, "ContraGrp({})", self.0)
70    }
71}