Skip to main content

refix_fix44/generated/components/
settl_instructions_data.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Instances, InvalidValue, KnownTags, LazyKnownTags, Tag};
5
6use super::super::enums::{SettlDeliveryType, StandInstDbType};
7use super::DlvyInstGrp;
8
9/// The fields of the `SettlInstructionsData` component.
10#[derive(Clone, Copy)]
11pub struct SettlInstructionsData<'a>(
12    pub(in super::super) refix_message::Scope<'a>,
13    pub(in super::super) KnownTags<'static>,
14);
15
16impl<'a> SettlInstructionsData<'a> {
17    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
18        static TAGS: LazyKnownTags = LazyKnownTags::new(
19            &[Tag(172), Tag(169), Tag(170), Tag(171), Tag(85)],
20            &[DlvyInstGrp::known_tags()],
21        );
22        &TAGS
23    }
24
25    pub fn raw(&self) -> refix_message::Scope<'a> {
26        self.0
27    }
28
29    /// The `SettlDeliveryType` (172) field.
30    #[doc(alias = "SettlDeliveryType")]
31    pub fn settl_delivery_type(&self) -> Result<Option<SettlDeliveryType>, InvalidValue> {
32        Ok(self.0.get_int(Tag(172))?.map(SettlDeliveryType::from_value))
33    }
34
35    /// The `StandInstDbType` (169) field.
36    #[doc(alias = "StandInstDbType")]
37    pub fn stand_inst_db_type(&self) -> Result<Option<StandInstDbType>, InvalidValue> {
38        Ok(self.0.get_int(Tag(169))?.map(StandInstDbType::from_value))
39    }
40
41    /// The `StandInstDbName` (170) field.
42    #[doc(alias = "StandInstDbName")]
43    pub fn stand_inst_db_name(&self) -> Result<Option<&'a str>, InvalidValue> {
44        self.0.get_str(Tag(170))
45    }
46
47    /// The `StandInstDbID` (171) field.
48    #[doc(alias = "StandInstDbID")]
49    pub fn stand_inst_db_id(&self) -> Result<Option<&'a str>, InvalidValue> {
50        self.0.get_str(Tag(171))
51    }
52
53    /// The instances of the `NoDlvyInst` (85) group.
54    #[doc(alias = "NoDlvyInst")]
55    pub fn dlvy_inst(&self) -> Result<Instances<'a, DlvyInstGrp<'a>>, InvalidValue> {
56        self.0.get_group(&DlvyInstGrp::TABLE, &self.1).map(Instances::from)
57    }
58}
59
60impl std::fmt::Debug for SettlInstructionsData<'_> {
61    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
62        write!(f, "SettlInstructionsData({})", self.0.display_known(&Self::known_tags().get()))
63    }
64}