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

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

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

impl<'a> TrdCapDtGrp<'a> {
    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
        Tag(580),
        Tag(75),
        &[Tag(60), Tag(75)],
        &[],
    );

    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
        static TAGS: LazyKnownTags = LazyKnownTags::new(&[Tag(75), Tag(60)], &[]);
        &TAGS
    }

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

    /// The `TradeDate` (75) field.
    #[doc(alias = "TradeDate")]
    pub fn trade_date(&self) -> Result<Option<Date>, InvalidValue> {
        self.0.get_date(Tag(75))
    }

    /// The `TransactTime` (60) field.
    #[doc(alias = "TransactTime")]
    pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
        self.0.get_utc_timestamp(Tag(60))
    }
}

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