refix-fix44 0.12.0

Typed FIX 4.4 protocol messages for the ReFIX engine
Documentation
// @generated by refix codegen from FIX44.xml. Do not edit.
#![cfg_attr(rustfmt, rustfmt::skip)]

use refix_message::{Instances, InvalidValue, KnownTags, LazyKnownTags, Tag};

use super::super::enums::{SettlDeliveryType, StandInstDbType};
use super::DlvyInstGrp;

/// The fields of the `SettlInstructionsData` component.
#[derive(Clone, Copy)]
pub struct SettlInstructionsData<'a>(
    pub(in super::super) refix_message::Scope<'a>,
    pub(in super::super) KnownTags<'static>,
);

impl<'a> SettlInstructionsData<'a> {
    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
        static TAGS: LazyKnownTags = LazyKnownTags::new(
            &[Tag(172), Tag(169), Tag(170), Tag(171), Tag(85)],
            &[DlvyInstGrp::known_tags()],
        );
        &TAGS
    }

    pub fn raw(&self) -> refix_message::Scope<'a> {
        self.0
    }

    /// The `SettlDeliveryType` (172) field.
    #[doc(alias = "SettlDeliveryType")]
    pub fn settl_delivery_type(&self) -> Result<Option<SettlDeliveryType>, InvalidValue> {
        Ok(self.0.get_int(Tag(172))?.map(SettlDeliveryType::from_value))
    }

    /// The `StandInstDbType` (169) field.
    #[doc(alias = "StandInstDbType")]
    pub fn stand_inst_db_type(&self) -> Result<Option<StandInstDbType>, InvalidValue> {
        Ok(self.0.get_int(Tag(169))?.map(StandInstDbType::from_value))
    }

    /// The `StandInstDbName` (170) field.
    #[doc(alias = "StandInstDbName")]
    pub fn stand_inst_db_name(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(170))
    }

    /// The `StandInstDbID` (171) field.
    #[doc(alias = "StandInstDbID")]
    pub fn stand_inst_db_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(171))
    }

    /// The instances of the `NoDlvyInst` (85) group.
    #[doc(alias = "NoDlvyInst")]
    pub fn dlvy_inst(&self) -> Result<Instances<'a, DlvyInstGrp<'a>>, InvalidValue> {
        self.0.get_group(&DlvyInstGrp::TABLE, &self.1).map(Instances::from)
    }
}

impl std::fmt::Debug for SettlInstructionsData<'_> {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "SettlInstructionsData({})", self.0.display_known(&Self::known_tags().get()))
    }
}