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

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

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

impl<'a> AllocAckGrp<'a> {
    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
        Tag(78),
        Tag(79),
        &[Tag(79), Tag(161), Tag(360), Tag(361), Tag(366), Tag(467), Tag(661), Tag(776)],
        &[],
    );

    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
        static TAGS: LazyKnownTags = LazyKnownTags::new(
            &[Tag(79), Tag(661), Tag(366), Tag(467), Tag(776), Tag(161), Tag(360), Tag(361)],
            &[],
        );
        &TAGS
    }

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

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

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

    /// The `AllocPrice` (366) field.
    #[doc(alias = "AllocPrice")]
    pub fn alloc_price(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(366))
    }

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

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

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

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

    /// The `EncodedAllocText` (361) field.
    #[doc(alias = "EncodedAllocText")]
    pub fn encoded_alloc_text(&self) -> Option<&'a [u8]> {
        self.0.get(Tag(361))
    }
}

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