Skip to main content

refix_fix44/generated/messages/
list_status_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 `ListStatusRequest` (35=M) message.
9pub struct ListStatusRequest(RawMessage);
10
11impl ListStatusRequest {
12    pub const MSG_TYPE: &[u8] = b"M";
13
14    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
15        static TAGS: LazyKnownTags = LazyKnownTags::new(
16            &[Tag(66), Tag(58), Tag(354), Tag(355)],
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 `ListID` (66) field.
39    #[doc(alias = "ListID")]
40    pub fn list_id(&self) -> Result<Option<&str>, InvalidValue> {
41        self.0.get_str(Tag(66))
42    }
43
44    /// The `Text` (58) field.
45    #[doc(alias = "Text")]
46    pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
47        self.0.get_str(Tag(58))
48    }
49
50    /// The `EncodedTextLen` (354) field.
51    #[doc(alias = "EncodedTextLen")]
52    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
53        self.0.get_int(Tag(354))
54    }
55
56    /// The `EncodedText` (355) field.
57    #[doc(alias = "EncodedText")]
58    pub fn encoded_text(&self) -> Option<&[u8]> {
59        self.0.get(Tag(355))
60    }
61}
62
63impl std::fmt::Debug for ListStatusRequest {
64    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
65        write!(f, "ListStatusRequest({})", self.0)
66    }
67}
68
69impl std::fmt::Display for ListStatusRequest {
70    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
71        std::fmt::Display::fmt(&self.0, f)
72    }
73}