#![cfg_attr(rustfmt, rustfmt::skip)]
use refix_message::{Instances, InvalidValue, KnownTags, LazyKnownTags, Tag};
use super::super::enums::{SettlDeliveryType, StandInstDbType};
use super::DlvyInstGrp;
#[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
}
#[doc(alias = "SettlDeliveryType")]
pub fn settl_delivery_type(&self) -> Result<Option<SettlDeliveryType>, InvalidValue> {
Ok(self.0.get_int(Tag(172))?.map(SettlDeliveryType::from_value))
}
#[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))
}
#[doc(alias = "StandInstDbName")]
pub fn stand_inst_db_name(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(170))
}
#[doc(alias = "StandInstDbID")]
pub fn stand_inst_db_id(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(171))
}
#[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()))
}
}