Skip to main content

Crate ironfix_session

Crate ironfix_session 

Source
Expand description

§IronFix Session

FIX session layer protocol implementation for the IronFix engine.

This crate is pure protocol logic: it performs no I/O, encodes no bytes and persists nothing. Its only IronFix dependency is ironfix-core.

This crate provides:

  • State machine: a sealed typestate session FSM (Disconnected → Connecting → LogonSent/LogonReceived → Active → Resending/LogoutPending), so illegal transitions do not compile
  • Sequence management: SequenceManager with checked arithmetic — exhaustion is a typed error, never a silent wrap. Gap detection (SequenceResult::Gap) lives here; the recovery that follows (ResendRequest, SequenceReset, gap fill) is orchestrated by ironfix-engine, which owns the socket
  • Heartbeat handling: HeartbeatManager, Instant-based timing for heartbeat and TestRequest deadlines and HeartBtInt negotiation
  • Configuration: SessionConfig and its validating config::SessionConfigBuilder

Note that the Resending state is only the FSM marker for “a resend is in progress”. The actual ResendRequest / SequenceReset / gap-fill message handling lives in ironfix-engine, because it requires the wire layer.

Re-exports§

pub use config::SessionConfig;
pub use config::SessionConfigBuilder;
pub use config::SessionConfigError;
pub use heartbeat::HeartbeatIntervalError;
pub use heartbeat::HeartbeatManager;
pub use heartbeat::MAX_HEARTBEAT_INTERVAL_SECS;
pub use heartbeat::TestRequestOutcome;
pub use heartbeat::generate_test_req_id;
pub use heartbeat::negotiate_interval;
pub use sequence::SequenceCounter;
pub use sequence::SequenceExhausted;
pub use sequence::SequenceManager;
pub use sequence::SequenceResult;
pub use state::Active;
pub use state::Connecting;
pub use state::Disconnected;
pub use state::LogonReceived;
pub use state::LogonSent;
pub use state::LogoutPending;
pub use state::Resending;
pub use state::Session;
pub use state::SessionState;

Modules§

config
Session configuration.
heartbeat
Heartbeat and TestRequest management.
sequence
Sequence number management.
state
Session state machine using the typestate pattern.