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::{GroupTable, Instances, InvalidValue, LazyKnownTags, Tag};

use super::NstdPtys3SubGrp;

/// An instance of the `NoNested3PartyIDs` (948) group.
#[derive(Clone, Copy)]
pub struct NestedParties3<'a>(refix_message::Scope<'a>);

impl<'a> From<refix_message::Scope<'a>> for NestedParties3<'a> {
    fn from(scope: refix_message::Scope<'a>) -> Self {
        Self(scope)
    }
}

impl<'a> NestedParties3<'a> {
    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
        Tag(948),
        Tag(949),
        &[Tag(949), Tag(950), Tag(951), Tag(952)],
        &[NstdPtys3SubGrp::TABLE],
    );

    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
        static TAGS: LazyKnownTags = LazyKnownTags::new(
            &[Tag(949), Tag(950), Tag(951), Tag(952)],
            &[NstdPtys3SubGrp::known_tags()],
        );
        &TAGS
    }

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

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

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

    /// The `Nested3PartyRole` (951) field.
    #[doc(alias = "Nested3PartyRole")]
    pub fn nested3_party_role(&self) -> Result<Option<i64>, InvalidValue> {
        self.0.get_int(Tag(951))
    }

    /// The instances of the `NoNested3PartySubIDs` (952) group.
    #[doc(alias = "NoNested3PartySubIDs")]
    pub fn nested3_party_sub_ids(&self) -> Result<Instances<'a, NstdPtys3SubGrp<'a>>, InvalidValue> {
        self.0.get_group(&NstdPtys3SubGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
    }
}

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