refix_fix44/generated/messages/
bid_response.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Instances, InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{BidCompRspGrp, Header, Trailer};
7
8pub struct BidResponse(RawMessage);
10
11impl BidResponse {
12 pub const MSG_TYPE: &[u8] = b"l";
13
14 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
15 static TAGS: LazyKnownTags = LazyKnownTags::new(
16 &[Tag(390), Tag(391), Tag(420)],
17 &[Header::known_tags(), Trailer::known_tags(), BidCompRspGrp::known_tags()],
18 );
19 &TAGS
20 }
21
22 pub fn from_raw(raw: RawMessage) -> Self {
23 Self(raw)
24 }
25
26 pub fn raw(&self) -> &RawMessage {
27 &self.0
28 }
29
30 pub fn header(&self) -> Header<'_> {
31 Header(self.0.scope(), Self::known_tags().get())
32 }
33
34 pub fn trailer(&self) -> Trailer<'_> {
35 Trailer(self.0.scope())
36 }
37
38 #[doc(alias = "BidID")]
40 pub fn bid_id(&self) -> Result<Option<&str>, InvalidValue> {
41 self.0.get_str(Tag(390))
42 }
43
44 #[doc(alias = "ClientBidID")]
46 pub fn client_bid_id(&self) -> Result<Option<&str>, InvalidValue> {
47 self.0.get_str(Tag(391))
48 }
49
50 #[doc(alias = "NoBidComponents")]
52 pub fn bid_components(&self) -> Result<Instances<'_, BidCompRspGrp<'_>>, InvalidValue> {
53 self.0.get_group(&BidCompRspGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
54 }
55}
56
57impl std::fmt::Debug for BidResponse {
58 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
59 write!(f, "BidResponse({})", self.0)
60 }
61}
62
63impl std::fmt::Display for BidResponse {
64 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
65 std::fmt::Display::fmt(&self.0, f)
66 }
67}