-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdefinitions.rs
More file actions
62 lines (54 loc) · 1.69 KB
/
definitions.rs
File metadata and controls
62 lines (54 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! Field and message definitions for all FIX application versions.
//!
//! # What is this and why is this necessary?
//!
//! HotFIX internals rely on [`Dictionary`](crate::Dictionary) for accessing
//! details about fields, messages and other abstract entities defined in the
//! FIX Dictionary specifications. Although this approach works quite well, it
//! can become daunting to query a [`Dictionary`](crate::Dictionary) for even
//! the most basic operation.
use crate::dict::FixDatatype;
use crate::{TagU32, dict};
#[derive(Debug, Clone)]
#[doc(hidden)]
pub struct HardCodedFixFieldDefinition {
pub name: &'static str,
pub tag: u32,
pub data_type: FixDatatype,
pub location: dict::FieldLocation,
}
impl dict::IsFieldDefinition for HardCodedFixFieldDefinition {
#[inline]
fn tag(&self) -> TagU32 {
#[allow(clippy::expect_used)]
TagU32::new(self.tag).expect("Invalid tag number 0.")
}
#[inline]
fn name(&self) -> &str {
self.name
}
#[inline]
fn location(&self) -> dict::FieldLocation {
self.location
}
}
#[cfg(feature = "fix42")]
#[allow(dead_code, unused, warnings, enum_variant_names)]
#[rustfmt::skip]
/// Field and message definitions for FIX.4.4.
pub mod fix42 {
include!(concat!(env!("OUT_DIR"), "/fix42.rs"));
}
#[cfg(feature = "fix44")]
#[allow(dead_code, unused, warnings, enum_variant_names)]
#[rustfmt::skip]
/// Field and message definitions for FIX.4.4.
pub mod fix44 {
include!(concat!(env!("OUT_DIR"), "/fix44.rs"));
}
#[allow(dead_code, unused, warnings, enum_variant_names)]
#[rustfmt::skip]
/// Field and message definitions for FIX.4.4.
pub mod fixt11 {
include!(concat!(env!("OUT_DIR"), "/fixt11.rs"));
}