#![cfg_attr(rustfmt, rustfmt::skip)]
use refix_message::{GroupTable, InvalidValue, LazyKnownTags, Tag};
use super::super::enums::InstrAttribType;
#[derive(Clone, Copy)]
pub struct AttrbGrp<'a>(refix_message::Scope<'a>);
impl<'a> From<refix_message::Scope<'a>> for AttrbGrp<'a> {
fn from(scope: refix_message::Scope<'a>) -> Self {
Self(scope)
}
}
impl<'a> AttrbGrp<'a> {
pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
Tag(870),
Tag(871),
&[Tag(871), Tag(872)],
&[],
);
pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
static TAGS: LazyKnownTags = LazyKnownTags::new(&[Tag(871), Tag(872)], &[]);
&TAGS
}
pub fn raw(&self) -> refix_message::Scope<'a> {
self.0
}
#[doc(alias = "InstrAttribType")]
pub fn instr_attrib_type(&self) -> Result<Option<InstrAttribType>, InvalidValue> {
Ok(self.0.get_int(Tag(871))?.map(InstrAttribType::from_value))
}
#[doc(alias = "InstrAttribValue")]
pub fn instr_attrib_value(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(872))
}
}
impl std::fmt::Debug for AttrbGrp<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "AttrbGrp({})", self.0)
}
}