Skip to main content

refix_fix44/generated/messages/
xml_non_fix.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{LazyKnownTags, RawMessage};
5
6use super::super::components::{Header, Trailer};
7
8/// The `XMLnonFIX` (35=n) message.
9pub struct XMLnonFIX(RawMessage);
10
11impl XMLnonFIX {
12    pub const MSG_TYPE: &[u8] = b"n";
13
14    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
15        static TAGS: LazyKnownTags = LazyKnownTags::new(
16            &[],
17            &[Header::known_tags(), Trailer::known_tags()],
18        );
19        &TAGS
20    }
21
22    pub fn from_raw(raw: RawMessage) -> Self {
23        Self(raw)
24    }
25
26    pub fn raw(&self) -> &RawMessage {
27        &self.0
28    }
29
30    pub fn header(&self) -> Header<'_> {
31        Header(self.0.scope(), Self::known_tags().get())
32    }
33
34    pub fn trailer(&self) -> Trailer<'_> {
35        Trailer(self.0.scope())
36    }
37}
38
39impl std::fmt::Debug for XMLnonFIX {
40    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
41        write!(f, "XMLnonFIX({})", self.0)
42    }
43}
44
45impl std::fmt::Display for XMLnonFIX {
46    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
47        std::fmt::Display::fmt(&self.0, f)
48    }
49}