refix_fix44/generated/messages/
list_status.rs1#![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
9pub 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 #[doc(alias = "ListID")]
44 pub fn list_id(&self) -> Result<Option<&str>, InvalidValue> {
45 self.0.get_str(Tag(66))
46 }
47
48 #[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 #[doc(alias = "NoRpts")]
56 pub fn no_rpts(&self) -> Result<Option<i64>, InvalidValue> {
57 self.0.get_int(Tag(82))
58 }
59
60 #[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 #[doc(alias = "RptSeq")]
68 pub fn rpt_seq(&self) -> Result<Option<i64>, InvalidValue> {
69 self.0.get_int(Tag(83))
70 }
71
72 #[doc(alias = "ListStatusText")]
74 pub fn list_status_text(&self) -> Result<Option<&str>, InvalidValue> {
75 self.0.get_str(Tag(444))
76 }
77
78 #[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 #[doc(alias = "EncodedListStatusText")]
86 pub fn encoded_list_status_text(&self) -> Option<&[u8]> {
87 self.0.get(Tag(446))
88 }
89
90 #[doc(alias = "TransactTime")]
92 pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
93 self.0.get_utc_timestamp(Tag(60))
94 }
95
96 #[doc(alias = "TotNoOrders")]
98 pub fn tot_no_orders(&self) -> Result<Option<i64>, InvalidValue> {
99 self.0.get_int(Tag(68))
100 }
101
102 #[doc(alias = "LastFragment")]
104 pub fn last_fragment(&self) -> Result<Option<bool>, InvalidValue> {
105 self.0.get_bool(Tag(893))
106 }
107
108 #[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}