pub struct Config {Show 17 fields
pub username: String,
pub password: String,
pub host: String,
pub port: u16,
pub use_ssl: bool,
pub test_mode: bool,
pub heartbeat_interval: u32,
pub connection_timeout: Duration,
pub reconnect_attempts: u32,
pub reconnect_delay: Duration,
pub enable_logging: bool,
pub log_level: String,
pub sender_comp_id: String,
pub target_comp_id: String,
pub cancel_on_disconnect: bool,
pub app_id: Option<String>,
pub app_secret: Option<String>,
}Expand description
Configuration for the Deribit FIX client
Fields§
§username: StringDeribit username
password: StringDeribit password
host: StringFIX server host (default: www.deribit.com for production, test.deribit.com for test)
port: u16FIX server port (default: 9881 for test, 9880 for production)
use_ssl: boolWhether to use SSL connection (default: false for raw TCP)
test_mode: boolWhether to use test environment
heartbeat_interval: u32Heartbeat interval in seconds (default: 30)
connection_timeout: DurationConnection timeout in seconds (default: 10)
reconnect_attempts: u32Reconnection attempts (default: 3)
reconnect_delay: DurationReconnection delay in seconds (default: 5)
enable_logging: boolEnable logging (default: true)
log_level: StringLog level filter
sender_comp_id: StringSender company ID for FIX messages
target_comp_id: StringTarget company ID for FIX messages (DERIBITSERVER)
cancel_on_disconnect: boolCancel orders on disconnect (default: false)
app_id: Option<String>Application ID for registered applications
app_secret: Option<String>Application secret for registered applications
Implementations§
Source§impl Config
impl Config
Sourcepub fn new(username: String, password: String) -> Self
pub fn new(username: String, password: String) -> Self
Create a new configuration with username and password
Sourcepub fn production(username: String, password: String) -> Self
pub fn production(username: String, password: String) -> Self
Create configuration for production environment
Sourcepub fn production_ssl(username: String, password: String) -> Self
pub fn production_ssl(username: String, password: String) -> Self
Create configuration for production environment with SSL
Sourcepub fn test_ssl(username: String, password: String) -> Self
pub fn test_ssl(username: String, password: String) -> Self
Create configuration for test environment with SSL
Sourcepub fn with_endpoint(self, host: String, port: u16) -> Self
pub fn with_endpoint(self, host: String, port: u16) -> Self
Set custom host and port
Sourcepub fn with_heartbeat_interval(self, interval: u32) -> Self
pub fn with_heartbeat_interval(self, interval: u32) -> Self
Set heartbeat interval
Sourcepub fn with_connection_timeout(self, timeout: Duration) -> Self
pub fn with_connection_timeout(self, timeout: Duration) -> Self
Set connection timeout
Sourcepub fn with_reconnection(self, attempts: u32, delay: Duration) -> Self
pub fn with_reconnection(self, attempts: u32, delay: Duration) -> Self
Set reconnection parameters
Sourcepub fn with_logging(self, enabled: bool, level: String) -> Self
pub fn with_logging(self, enabled: bool, level: String) -> Self
Set logging configuration
Sourcepub fn with_session_ids(
self,
sender_comp_id: String,
target_comp_id: String,
) -> Self
pub fn with_session_ids( self, sender_comp_id: String, target_comp_id: String, ) -> Self
Set FIX session identifiers
Sourcepub fn with_cancel_on_disconnect(self, cancel_on_disconnect: bool) -> Self
pub fn with_cancel_on_disconnect(self, cancel_on_disconnect: bool) -> Self
Set cancel on disconnect behavior
Sourcepub fn with_app_credentials(self, app_id: String, app_secret: String) -> Self
pub fn with_app_credentials(self, app_id: String, app_secret: String) -> Self
Set application credentials for registered applications
Sourcepub fn connection_url(&self) -> String
pub fn connection_url(&self) -> String
Get the connection URL