Skip to main content

refix_fix44/generated/messages/
rfq_request.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, RFQReqGrp, Trailer};
7use super::super::enums::SubscriptionRequestType;
8
9/// The `RFQRequest` (35=AH) message.
10pub struct RFQRequest(RawMessage);
11
12impl RFQRequest {
13    pub const MSG_TYPE: &[u8] = b"AH";
14
15    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
16        static TAGS: LazyKnownTags = LazyKnownTags::new(
17            &[Tag(644), Tag(146), Tag(263)],
18            &[Header::known_tags(), Trailer::known_tags(), RFQReqGrp::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 `RFQReqID` (644) field.
40    #[doc(alias = "RFQReqID")]
41    pub fn rfq_req_id(&self) -> Result<Option<&str>, InvalidValue> {
42        self.0.get_str(Tag(644))
43    }
44
45    /// The instances of the `NoRelatedSym` (146) group.
46    #[doc(alias = "NoRelatedSym")]
47    pub fn related_sym(&self) -> Result<Instances<'_, RFQReqGrp<'_>>, InvalidValue> {
48        self.0.get_group(&RFQReqGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
49    }
50
51    /// The `SubscriptionRequestType` (263) field.
52    #[doc(alias = "SubscriptionRequestType")]
53    pub fn subscription_request_type(&self) -> Result<Option<SubscriptionRequestType<'_>>, InvalidValue> {
54        Ok(self.0.get_str(Tag(263))?.map(SubscriptionRequestType::from_value))
55    }
56}
57
58impl std::fmt::Debug for RFQRequest {
59    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
60        write!(f, "RFQRequest({})", self.0)
61    }
62}
63
64impl std::fmt::Display for RFQRequest {
65    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
66        std::fmt::Display::fmt(&self.0, f)
67    }
68}