#![cfg_attr(rustfmt, rustfmt::skip)]
use refix_message::{InvalidValue, RawMessage, Tag};
use super::super::components::{Header, Trailer};
pub struct TestRequest(RawMessage);
impl TestRequest {
pub const MSG_TYPE: &[u8] = b"1";
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())
}
pub fn trailer(&self) -> Trailer<'_> {
Trailer(self.0.scope())
}
#[doc(alias = "TestReqID")]
pub fn test_req_id(&self) -> Result<Option<&str>, InvalidValue> {
self.0.get_str(Tag(112))
}
}
impl std::fmt::Debug for TestRequest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "TestRequest({})", self.0)
}
}
impl std::fmt::Display for TestRequest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(&self.0, f)
}
}