Expand description
This project is an unofficial binding between quickfix library and Rust projects.
§Features
- Provide basic and safe API wrapper above quickfix library.
- Run on any hardware and operating system supported by Rust Tier 1 (Windows 7+, MacOS 10.12+ & Linux).
- Only include and compile what you need since project is split into minimal crates.
- Message decoding / encoding including run-time validation.
- Supports FIX versions 4x (version 5x can be build locally from XML spec file).
- Spec driven run-time message validation.
- Spec driven code generation of type-safe FIX messages, fields, and repeating groups.
- Session state storage options: SQL, File, In Memory.
- Logging options: stdout, stderr, log or any other crate if you implement your own trait.
§Project status
Project is working and most of the source library features are available.
It is ready for production and real application use cases.
API MAY CHANGE IN FUTURE VERSION
Crate is still in the reviewing process.
Feel free to participate and share your point of view on this github issue.
§Build requirements
Following package must be install to build the library:
cmake
- a C++ compiler (with C++17 support)
rustup
/rustc
/cargo
(obviously 😉)rustfmt
for auto generated messages from spec.
§Example usage
Here some minimal code sample to getting started:
// Configure FIX engine.
let mut settings = SessionSettings::new();
settings.set(
None,
Dictionary::try_from_items(&[
&ConnectionType::Acceptor,
])?
)?;
settings.set(
Some(&SessionId::try_new("FIX.4.4", "ME", "THEIR", "")?),
Dictionary::try_from_items(&[
&StartTime("12:30:00"),
&EndTime("23:30:00"),
&SocketAcceptPort(4000),
&DataDictionary("../quickfix-ffi/libquickfix/spec/FIX41.xml"),
])?
)?;
// Configure FIX callbacks.
pub struct MyApplication;
impl ApplicationCallback for MyApplication {
// Implement whatever callback you need
fn on_create(&self, _session: &SessionId) {
// Do whatever you want here 😁
}
}
// Create FIX objects.
let store_factory = MemoryMessageStoreFactory::new();
let log_factory = LogFactory::try_new(&StdLogger::Stdout)?;
let app = Application::try_new(&MyApplication)?;
let mut acceptor = SocketAcceptor::try_new(&settings, &app, &store_factory, &log_factory)?;
// Start session.
acceptor.start()?;
loop {
// Do whatever you want here ...
}
// End application
acceptor.stop()?;
Modules§
- Common dictionary configuration parameters.
Structs§
- Application callback wrapper.
- Represents a data dictionary for a version of FIX.
- For storage and retrieval of key/value pairs.
- File based implementation of
MessageStore
. - Base class for all FIX repeating groups.
- Header part of a FIX message.
- Logging factory.
- In memory implementation of
MessageStore
. - Base class for all FIX messages.
- Drop every log message.
- Null implementation of MessageStore.
- Log message using
log
crate. - FIX Session.
- Unique session id consists of BeginString, SenderCompID and TargetCompID.
- Container for setting dictionaries mapped to sessions.
- Socket implementation of incoming connections handler.
- Socket implementation of establishing connections handler.
- Trailer part of a FIX message.
Enums§
- Represent any day of the week.
- Error result that can occurs from a
on_msg_from_admin
callback. - Error result that can occurs from a
on_msg_from_app
callback. - Error result that can occurs from a
on_msg_to_app
callback. - Represent all possible error that can occurs with quickfix.
- Log message to std file descriptors.
Traits§
- These methods notify your application about events that happen on active FIX sessions.
- Permit control of an underlying socket connection.
- Object can be converted as a foreign object representing a
MessageStore
. - Stores and organizes a collection of Fields.
- Allow reading value (aka property) from a foreign (C++) object.
- Allow writing value (aka property) into a foreign (C++) object.
- Convert object to FIX value.
- Log event that can occurs in quickfix library.
- Define a container of session
Functions§
- Send message to target design in session ID.