Skip to main content

quickfix_tokio/
lib.rs

1//! # quickfix-tokio
2//!
3//! A pure-Rust FIX protocol engine built natively on tokio — no C++
4//! bindings, no blocking threads. Protocol behavior follows the reference
5//! QuickFIX engines (C++, Go, .NET); the concurrency model is one tokio
6//! task per session that owns all session state, with sockets and API
7//! handles connected purely by channels.
8//!
9//! The engine is written entirely in safe Rust (`#![forbid(unsafe_code)]`).
10//!
11//! ```no_run
12//! use std::sync::Arc;
13//! use quickfix_tokio::{Application, Engine, Settings, MemoryStoreFactory, TracingLogFactory};
14//!
15//! struct MyApp;
16//! impl Application for MyApp {}
17//!
18//! # async fn run() -> quickfix_tokio::Result<()> {
19//! let settings = Settings::from_file("fix.cfg").await?;
20//! let engine = Engine::start(
21//!     &settings,
22//!     Arc::new(MyApp),
23//!     Arc::new(MemoryStoreFactory::new()),
24//!     Arc::new(TracingLogFactory),
25//! ).await?;
26//! # Ok(())
27//! # }
28//! ```
29#![forbid(unsafe_code)]
30
31pub mod application;
32pub mod datadictionary;
33pub mod engine;
34#[cfg(feature = "fix44")]
35pub mod fix44;
36pub mod error;
37pub mod field_map;
38pub mod log;
39pub mod message;
40pub mod parser;
41pub mod schedule;
42pub mod session;
43pub mod session_id;
44pub mod settings;
45pub mod store;
46pub mod tags;
47#[cfg(feature = "tls")]
48mod tls;
49mod transport;
50pub mod value;
51
52pub use application::{
53    Application, ApplicationError, ChannelApplication, DoNotSend, SessionEvent, event_channel,
54};
55pub use datadictionary::{DataDictionary, ValidationSettings};
56pub use engine::Engine;
57pub use error::{Error, RejectError, Result, SessionRejectReason};
58pub use field_map::{FieldMap, GroupTemplate};
59pub use log::{FileLogFactory, Log, LogFactory, NullLogFactory, Rotation, TracingLogFactory};
60pub use message::{Message, Tag};
61pub use session::{SessionHandle, SessionStatus};
62pub use session_id::SessionId;
63pub use settings::{ConnectionType, SessionConfig, Settings, TlsSettings};
64pub use store::{
65    FileStoreFactory, MemoryStoreFactory, MessageStore, MessageStoreFactory,
66};
67pub use value::{FixDate, TimestampPrecision, UtcTimestamp};
68
69/// The numeric type for FIX float-family fields (Price, Qty, Amt, Float,
70/// Percentage). Exact fixed-point [`rust_decimal::Decimal`] with the
71/// `decimal` feature (default), or `f64` without it. Generated typed
72/// accessors use this alias, so the whole typed API switches with the
73/// feature.
74#[cfg(feature = "decimal")]
75pub type Amount = rust_decimal::Decimal;
76#[cfg(not(feature = "decimal"))]
77pub type Amount = f64;
78
79#[cfg(feature = "decimal")]
80pub use rust_decimal::{Decimal, dec};