refix_fix44/generated/components/
order_qty_data.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Decimal, InvalidValue, LazyKnownTags, Tag};
5
6use super::super::enums::RoundingDirection;
7
8#[derive(Clone, Copy)]
10pub struct OrderQtyData<'a>(pub(in super::super) refix_message::Scope<'a>);
11
12impl<'a> OrderQtyData<'a> {
13 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
14 static TAGS: LazyKnownTags = LazyKnownTags::new(
15 &[Tag(38), Tag(152), Tag(516), Tag(468), Tag(469)],
16 &[],
17 );
18 &TAGS
19 }
20
21 pub fn raw(&self) -> refix_message::Scope<'a> {
22 self.0
23 }
24
25 #[doc(alias = "OrderQty")]
27 pub fn order_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
28 self.0.get_decimal(Tag(38))
29 }
30
31 #[doc(alias = "CashOrderQty")]
33 pub fn cash_order_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
34 self.0.get_decimal(Tag(152))
35 }
36
37 #[doc(alias = "OrderPercent")]
39 pub fn order_percent(&self) -> Result<Option<Decimal>, InvalidValue> {
40 self.0.get_decimal(Tag(516))
41 }
42
43 #[doc(alias = "RoundingDirection")]
45 pub fn rounding_direction(&self) -> Result<Option<RoundingDirection<'a>>, InvalidValue> {
46 Ok(self.0.get_str(Tag(468))?.map(RoundingDirection::from_value))
47 }
48
49 #[doc(alias = "RoundingModulus")]
51 pub fn rounding_modulus(&self) -> Result<Option<Decimal>, InvalidValue> {
52 self.0.get_decimal(Tag(469))
53 }
54}
55
56impl std::fmt::Debug for OrderQtyData<'_> {
57 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
58 write!(f, "OrderQtyData({})", self.0.display_known(&Self::known_tags().get()))
59 }
60}