Skip to main content

refix_fix44/generated/messages/
resend_request.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{Header, Trailer};
7
8/// The `ResendRequest` (35=2) message.
9pub struct ResendRequest(RawMessage);
10
11impl ResendRequest {
12    pub const MSG_TYPE: &[u8] = b"2";
13
14    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
15        static TAGS: LazyKnownTags = LazyKnownTags::new(
16            &[Tag(7), Tag(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    /// The `BeginSeqNo` (7) field.
39    #[doc(alias = "BeginSeqNo")]
40    pub fn begin_seq_no(&self) -> Result<Option<i64>, InvalidValue> {
41        self.0.get_int(Tag(7))
42    }
43
44    /// The `EndSeqNo` (16) field.
45    #[doc(alias = "EndSeqNo")]
46    pub fn end_seq_no(&self) -> Result<Option<i64>, InvalidValue> {
47        self.0.get_int(Tag(16))
48    }
49}
50
51impl std::fmt::Debug for ResendRequest {
52    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
53        write!(f, "ResendRequest({})", self.0)
54    }
55}
56
57impl std::fmt::Display for ResendRequest {
58    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
59        std::fmt::Display::fmt(&self.0, f)
60    }
61}