Skip to main content

refix_fix44/generated/messages/
list_strike_price.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, InstrmtStrkPxGrp, Trailer, UndInstrmtStrkPxGrp};
7
8/// The `ListStrikePrice` (35=m) message.
9pub struct ListStrikePrice(RawMessage);
10
11impl ListStrikePrice {
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(422), Tag(893), Tag(428), Tag(711)],
17            &[
18                Header::known_tags(), Trailer::known_tags(), InstrmtStrkPxGrp::known_tags(),
19                UndInstrmtStrkPxGrp::known_tags(),
20            ],
21        );
22        &TAGS
23    }
24
25    pub fn from_raw(raw: RawMessage) -> Self {
26        Self(raw)
27    }
28
29    pub fn raw(&self) -> &RawMessage {
30        &self.0
31    }
32
33    pub fn header(&self) -> Header<'_> {
34        Header(self.0.scope(), Self::known_tags().get())
35    }
36
37    pub fn trailer(&self) -> Trailer<'_> {
38        Trailer(self.0.scope())
39    }
40
41    /// The `ListID` (66) field.
42    #[doc(alias = "ListID")]
43    pub fn list_id(&self) -> Result<Option<&str>, InvalidValue> {
44        self.0.get_str(Tag(66))
45    }
46
47    /// The `TotNoStrikes` (422) field.
48    #[doc(alias = "TotNoStrikes")]
49    pub fn tot_no_strikes(&self) -> Result<Option<i64>, InvalidValue> {
50        self.0.get_int(Tag(422))
51    }
52
53    /// The `LastFragment` (893) field.
54    #[doc(alias = "LastFragment")]
55    pub fn last_fragment(&self) -> Result<Option<bool>, InvalidValue> {
56        self.0.get_bool(Tag(893))
57    }
58
59    /// The instances of the `NoStrikes` (428) group.
60    #[doc(alias = "NoStrikes")]
61    pub fn strikes(&self) -> Result<Instances<'_, InstrmtStrkPxGrp<'_>>, InvalidValue> {
62        self.0.get_group(&InstrmtStrkPxGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
63    }
64
65    /// The instances of the `NoUnderlyings` (711) group.
66    #[doc(alias = "NoUnderlyings")]
67    pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtStrkPxGrp<'_>>, InvalidValue> {
68        self.0.get_group(&UndInstrmtStrkPxGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
69    }
70}
71
72impl std::fmt::Debug for ListStrikePrice {
73    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
74        write!(f, "ListStrikePrice({})", self.0)
75    }
76}
77
78impl std::fmt::Display for ListStrikePrice {
79    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
80        std::fmt::Display::fmt(&self.0, f)
81    }
82}