#[non_exhaustive]pub struct FixSessionEngineConfig { /* private fields */ }Expand description
Configuration for a deterministic FIX session engine.
The engine owns protocol state but not a socket, TLS implementation, clock, scheduler, or persistence backend. Hosts inject timestamps and transmit the caller-owned output buffer returned by each action.
Implementations§
Source§impl FixSessionEngineConfig
impl FixSessionEngineConfig
Sourcepub fn new(heartbeat_interval_secs: u32) -> Result<Self, FixSessionConfigError>
pub fn new(heartbeat_interval_secs: u32) -> Result<Self, FixSessionConfigError>
Creates a session configuration from the negotiated heartbeat interval.
By default the engine sends a TestRequest after 1.5 heartbeat intervals without inbound traffic and requests disconnect one heartbeat interval after an unanswered TestRequest. Logout uses the same one-heartbeat timeout.
§Errors
Returns FixSessionConfigError when the interval is zero or cannot be
represented in nanoseconds.
Sourcepub fn with_timeouts(
self,
test_request_after_ns: u64,
disconnect_after_test_request_ns: u64,
logout_timeout_ns: u64,
) -> Result<Self, FixSessionConfigError>
pub fn with_timeouts( self, test_request_after_ns: u64, disconnect_after_test_request_ns: u64, logout_timeout_ns: u64, ) -> Result<Self, FixSessionConfigError>
Overrides liveness and logout durations in nanoseconds.
test_request_after_ns is measured from the latest inbound frame.
disconnect_after_test_request_ns is measured from the TestRequest send
time. All durations must be non-zero.
§Errors
Returns FixSessionConfigError when any duration is zero.
Sourcepub const fn with_reset_seq_num_on_logon(self, enabled: bool) -> Self
pub const fn with_reset_seq_num_on_logon(self, enabled: bool) -> Self
Configures whether the next connection sends ResetSeqNumFlag(141)=Y.
When enabled, both local counters are reset to one immediately before the Logon sequence is assigned. This must only be enabled under an explicit bilateral session-reset agreement.
Sourcepub const fn with_comp_id_validation(self, enabled: bool) -> Self
pub const fn with_comp_id_validation(self, enabled: bool) -> Self
Configures strict sender/target component-id validation.
Validation is enabled by default. Disabling it is intended only for gateways whose authenticated transport rewrites component identifiers.
Sourcepub const fn heartbeat_interval_secs(&self) -> u32
pub const fn heartbeat_interval_secs(&self) -> u32
Returns the negotiated HeartBtInt(108) value in seconds.
Sourcepub const fn heartbeat_interval_ns(&self) -> u64
pub const fn heartbeat_interval_ns(&self) -> u64
Returns the outbound-heartbeat idle duration in nanoseconds.
Sourcepub const fn test_request_after_ns(&self) -> u64
pub const fn test_request_after_ns(&self) -> u64
Returns the inbound-idle duration before a TestRequest is sent.
Sourcepub const fn disconnect_after_test_request_ns(&self) -> u64
pub const fn disconnect_after_test_request_ns(&self) -> u64
Returns the unanswered-TestRequest duration before disconnect is requested.
Sourcepub const fn logout_timeout_ns(&self) -> u64
pub const fn logout_timeout_ns(&self) -> u64
Returns the Logout response timeout in nanoseconds.
Sourcepub const fn reset_seq_num_on_logon(&self) -> bool
pub const fn reset_seq_num_on_logon(&self) -> bool
Returns whether Logon requests a bilateral sequence reset.
Sourcepub const fn validate_comp_ids(&self) -> bool
pub const fn validate_comp_ids(&self) -> bool
Returns whether inbound component identifiers are validated.