Skip to main content

refix_fix44/generated/messages/
list_status.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Instances, InvalidValue, LazyKnownTags, RawMessage, Tag, UtcTimestamp};
5
6use super::super::components::{Header, OrdListStatGrp, Trailer};
7use super::super::enums::{ListOrderStatus, ListStatusType};
8
9/// The `ListStatus` (35=N) message.
10pub struct ListStatus(RawMessage);
11
12impl ListStatus {
13    pub const MSG_TYPE: &[u8] = b"N";
14
15    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
16        static TAGS: LazyKnownTags = LazyKnownTags::new(
17            &[
18                Tag(66), Tag(429), Tag(82), Tag(431), Tag(83), Tag(444), Tag(445), Tag(446),
19                Tag(60), Tag(68), Tag(893), Tag(73),
20            ],
21            &[Header::known_tags(), Trailer::known_tags(), OrdListStatGrp::known_tags()],
22        );
23        &TAGS
24    }
25
26    pub fn from_raw(raw: RawMessage) -> Self {
27        Self(raw)
28    }
29
30    pub fn raw(&self) -> &RawMessage {
31        &self.0
32    }
33
34    pub fn header(&self) -> Header<'_> {
35        Header(self.0.scope(), Self::known_tags().get())
36    }
37
38    pub fn trailer(&self) -> Trailer<'_> {
39        Trailer(self.0.scope())
40    }
41
42    /// The `ListID` (66) field.
43    #[doc(alias = "ListID")]
44    pub fn list_id(&self) -> Result<Option<&str>, InvalidValue> {
45        self.0.get_str(Tag(66))
46    }
47
48    /// The `ListStatusType` (429) field.
49    #[doc(alias = "ListStatusType")]
50    pub fn list_status_type(&self) -> Result<Option<ListStatusType>, InvalidValue> {
51        Ok(self.0.get_int(Tag(429))?.map(ListStatusType::from_value))
52    }
53
54    /// The `NoRpts` (82) field.
55    #[doc(alias = "NoRpts")]
56    pub fn no_rpts(&self) -> Result<Option<i64>, InvalidValue> {
57        self.0.get_int(Tag(82))
58    }
59
60    /// The `ListOrderStatus` (431) field.
61    #[doc(alias = "ListOrderStatus")]
62    pub fn list_order_status(&self) -> Result<Option<ListOrderStatus>, InvalidValue> {
63        Ok(self.0.get_int(Tag(431))?.map(ListOrderStatus::from_value))
64    }
65
66    /// The `RptSeq` (83) field.
67    #[doc(alias = "RptSeq")]
68    pub fn rpt_seq(&self) -> Result<Option<i64>, InvalidValue> {
69        self.0.get_int(Tag(83))
70    }
71
72    /// The `ListStatusText` (444) field.
73    #[doc(alias = "ListStatusText")]
74    pub fn list_status_text(&self) -> Result<Option<&str>, InvalidValue> {
75        self.0.get_str(Tag(444))
76    }
77
78    /// The `EncodedListStatusTextLen` (445) field.
79    #[doc(alias = "EncodedListStatusTextLen")]
80    pub fn encoded_list_status_text_len(&self) -> Result<Option<i64>, InvalidValue> {
81        self.0.get_int(Tag(445))
82    }
83
84    /// The `EncodedListStatusText` (446) field.
85    #[doc(alias = "EncodedListStatusText")]
86    pub fn encoded_list_status_text(&self) -> Option<&[u8]> {
87        self.0.get(Tag(446))
88    }
89
90    /// The `TransactTime` (60) field.
91    #[doc(alias = "TransactTime")]
92    pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
93        self.0.get_utc_timestamp(Tag(60))
94    }
95
96    /// The `TotNoOrders` (68) field.
97    #[doc(alias = "TotNoOrders")]
98    pub fn tot_no_orders(&self) -> Result<Option<i64>, InvalidValue> {
99        self.0.get_int(Tag(68))
100    }
101
102    /// The `LastFragment` (893) field.
103    #[doc(alias = "LastFragment")]
104    pub fn last_fragment(&self) -> Result<Option<bool>, InvalidValue> {
105        self.0.get_bool(Tag(893))
106    }
107
108    /// The instances of the `NoOrders` (73) group.
109    #[doc(alias = "NoOrders")]
110    pub fn orders(&self) -> Result<Instances<'_, OrdListStatGrp<'_>>, InvalidValue> {
111        self.0.get_group(&OrdListStatGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
112    }
113}
114
115impl std::fmt::Debug for ListStatus {
116    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
117        write!(f, "ListStatus({})", self.0)
118    }
119}
120
121impl std::fmt::Display for ListStatus {
122    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
123        std::fmt::Display::fmt(&self.0, f)
124    }
125}