This workspace is a set of Rust libraries for serialising to and deserialising from the FiX format. It is built upon Serde, a high performance generic serialization framework.
This workspace makes a really heavy use of proc-macros, building is really CPU and RAM intensive and can take a lot of time, at point of being killed by kernel OOM Killer.
This workspace is composed of:
- code_generator: utility to generate code from protocol specs
- enum_checker: utility to find duplicate enums across code
- fix40: FiX 4.0 entities
- fix41: FiX 4.1 entities
- fix42: FiX 4.2 entities
- fix43: FiX 4.3 entities
- fix44: FiX 4.4 entities
- fix50: FiX 5.0 entities
- fix50sp1: FiX 5.0SP1 entities
- fix50sp2: FiX 5.0SP2 entities
- fixt11: FiX Transport 1.1
- fix_common: common FiX entities, data type and structures
- fix_message: Modular multiversion message enum
- fix_message_viewer: Example application
- serde_fix: Serialization/Deserialization methods
In your Cargo.toml simply insert fix_message
for data structures and serde_fix
for serialization/deserialization APIs:
[dependencies]
fix_message = "*"
serde_fix = "*"
If you need only certain FiX protocol versions, to speed up build times, you can use fix_messages
features:
[dependencies]
fix_message = { version = "*", default-features = false, features = ["fix_50", "fix_50sp1", "fix_50sp2"] }
serde_fix = "*"
To deserialize a FiX message you can simply do:
let message: fix_message::Message = serde_fix::from_bytes(&buf).unwrap();
fix_message::Message
is an enum, every variant represents a different FiX version.
Inside every variant there is another enum, e.g. fix_message::fix40::Message
, that represents every message type for that version.
For example, a FiX 4.0 Logon message would decode like fix_message::Message::FIX40(fix_message::fix40::Message::Logon(Box<fix_message::fix40::messages::logon::Logon>))
.