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, InvalidValue, LazyKnownTags, Tag};

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

impl<'a> SpreadOrBenchmarkCurveData<'a> {
    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
        static TAGS: LazyKnownTags = LazyKnownTags::new(
            &[Tag(218), Tag(220), Tag(221), Tag(222), Tag(662), Tag(663), Tag(699), Tag(761)],
            &[],
        );
        &TAGS
    }

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

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

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

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

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

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

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

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

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

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