#![cfg_attr(rustfmt, rustfmt::skip)]
use refix_message::{LazyKnownTags, RawMessage};
use super::super::components::{Header, Trailer};
pub struct XMLnonFIX(RawMessage);
impl XMLnonFIX {
pub const MSG_TYPE: &[u8] = b"n";
pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
static TAGS: LazyKnownTags = LazyKnownTags::new(
&[],
&[Header::known_tags(), Trailer::known_tags()],
);
&TAGS
}
pub fn from_raw(raw: RawMessage) -> Self {
Self(raw)
}
pub fn raw(&self) -> &RawMessage {
&self.0
}
pub fn header(&self) -> Header<'_> {
Header(self.0.scope(), Self::known_tags().get())
}
pub fn trailer(&self) -> Trailer<'_> {
Trailer(self.0.scope())
}
}
impl std::fmt::Debug for XMLnonFIX {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "XMLnonFIX({})", self.0)
}
}
impl std::fmt::Display for XMLnonFIX {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(&self.0, f)
}
}