Skip to main content

refix_fix44/generated/components/
lines_of_text_grp.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{GroupTable, InvalidValue, LazyKnownTags, Tag};
5
6/// An instance of the `NoLinesOfText` (33) group.
7#[derive(Clone, Copy)]
8pub struct LinesOfTextGrp<'a>(refix_message::Scope<'a>);
9
10impl<'a> From<refix_message::Scope<'a>> for LinesOfTextGrp<'a> {
11    fn from(scope: refix_message::Scope<'a>) -> Self {
12        Self(scope)
13    }
14}
15
16impl<'a> LinesOfTextGrp<'a> {
17    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
18        Tag(33),
19        Tag(58),
20        &[Tag(58), Tag(354), Tag(355)],
21        &[],
22    );
23
24    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
25        static TAGS: LazyKnownTags = LazyKnownTags::new(&[Tag(58), Tag(354), Tag(355)], &[]);
26        &TAGS
27    }
28
29    pub fn raw(&self) -> refix_message::Scope<'a> {
30        self.0
31    }
32
33    /// The `Text` (58) field.
34    #[doc(alias = "Text")]
35    pub fn text(&self) -> Result<Option<&'a str>, InvalidValue> {
36        self.0.get_str(Tag(58))
37    }
38
39    /// The `EncodedTextLen` (354) field.
40    #[doc(alias = "EncodedTextLen")]
41    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
42        self.0.get_int(Tag(354))
43    }
44
45    /// The `EncodedText` (355) field.
46    #[doc(alias = "EncodedText")]
47    pub fn encoded_text(&self) -> Option<&'a [u8]> {
48        self.0.get(Tag(355))
49    }
50}
51
52impl std::fmt::Debug for LinesOfTextGrp<'_> {
53    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
54        write!(f, "LinesOfTextGrp({})", self.0)
55    }
56}