#![cfg_attr(rustfmt, rustfmt::skip)]
use refix_message::{InvalidValue, RawMessage, Tag};
use super::super::components::{Header, Trailer};
pub struct ResendRequest(RawMessage);
impl ResendRequest {
pub const MSG_TYPE: &[u8] = b"2";
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 = "BeginSeqNo")]
pub fn begin_seq_no(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(7))
}
#[doc(alias = "EndSeqNo")]
pub fn end_seq_no(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(16))
}
}
impl std::fmt::Debug for ResendRequest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ResendRequest({})", self.0)
}
}
impl std::fmt::Display for ResendRequest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(&self.0, f)
}
}