Skip to main content

refix_fix44/generated/messages/
market_data_incremental_refresh.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};
5
6use super::super::components::{Header, MDIncGrp, Trailer};
7use super::super::enums::ApplQueueResolution;
8
9/// The `MarketDataIncrementalRefresh` (35=X) message.
10pub struct MarketDataIncrementalRefresh(RawMessage);
11
12impl MarketDataIncrementalRefresh {
13    pub const MSG_TYPE: &[u8] = b"X";
14
15    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
16        static TAGS: LazyKnownTags = LazyKnownTags::new(
17            &[Tag(262), Tag(268), Tag(813), Tag(814)],
18            &[Header::known_tags(), Trailer::known_tags(), MDIncGrp::known_tags()],
19        );
20        &TAGS
21    }
22
23    pub fn from_raw(raw: RawMessage) -> Self {
24        Self(raw)
25    }
26
27    pub fn raw(&self) -> &RawMessage {
28        &self.0
29    }
30
31    pub fn header(&self) -> Header<'_> {
32        Header(self.0.scope(), Self::known_tags().get())
33    }
34
35    pub fn trailer(&self) -> Trailer<'_> {
36        Trailer(self.0.scope())
37    }
38
39    /// The `MDReqID` (262) field.
40    #[doc(alias = "MDReqID")]
41    pub fn md_req_id(&self) -> Result<Option<&str>, InvalidValue> {
42        self.0.get_str(Tag(262))
43    }
44
45    /// The instances of the `NoMDEntries` (268) group.
46    #[doc(alias = "NoMDEntries")]
47    pub fn md_entries(&self) -> Result<Instances<'_, MDIncGrp<'_>>, InvalidValue> {
48        self.0.get_group(&MDIncGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
49    }
50
51    /// The `ApplQueueDepth` (813) field.
52    #[doc(alias = "ApplQueueDepth")]
53    pub fn appl_queue_depth(&self) -> Result<Option<i64>, InvalidValue> {
54        self.0.get_int(Tag(813))
55    }
56
57    /// The `ApplQueueResolution` (814) field.
58    #[doc(alias = "ApplQueueResolution")]
59    pub fn appl_queue_resolution(&self) -> Result<Option<ApplQueueResolution>, InvalidValue> {
60        Ok(self.0.get_int(Tag(814))?.map(ApplQueueResolution::from_value))
61    }
62}
63
64impl std::fmt::Debug for MarketDataIncrementalRefresh {
65    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
66        write!(f, "MarketDataIncrementalRefresh({})", self.0)
67    }
68}
69
70impl std::fmt::Display for MarketDataIncrementalRefresh {
71    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
72        std::fmt::Display::fmt(&self.0, f)
73    }
74}