pub struct ConfigurationFix { /* private fields */ }Expand description
Validated configuration of the FIX sessions of one trading account.
The password never appears in Debug output.
Implementations§
Source§impl ConfigurationFix
impl ConfigurationFix
Sourcepub fn builder() -> ConfigurationFixBuilder
pub fn builder() -> ConfigurationFixBuilder
Starts a configuration; the sessions run over TLS unless
ConfigurationFixBuilder::unencrypted is called.
Sourcepub fn from_env() -> Result<Self, ConfigError>
pub fn from_env() -> Result<Self, ConfigError>
Builds a configuration from the process environment.
See ConfigurationFix::from_lookup for the variables read.
§Errors
Returns a ConfigError when a required variable is absent or a value is rejected.
Sourcepub fn from_lookup(
lookup: impl Fn(&str) -> Option<String>,
) -> Result<Self, ConfigError>
pub fn from_lookup( lookup: impl Fn(&str) -> Option<String>, ) -> Result<Self, ConfigError>
Builds a configuration from variables resolved by lookup.
ENV_FIX_HOST, ENV_FIX_SENDER_COMP_ID, ENV_FIX_USERNAME and
ENV_FIX_PASSWORD are required. ENV_FIX_QUOTE_PORT and ENV_FIX_TRADE_PORT
replace the default TLS ports. ENV_FIX_TARGET_COMP_ID replaces
DEFAULT_FIX_TARGET_COMP_ID and is sent as given; the server reads it without regard
to case. An empty value counts as absent. The sessions run over TLS.
§Errors
Returns a ConfigError when a required variable is absent or a value is rejected.
Sourcepub const fn quote_port(&self) -> u16
pub const fn quote_port(&self) -> u16
Returns the port of the price session.
Sourcepub const fn trade_port(&self) -> u16
pub const fn trade_port(&self) -> u16
Returns the port of the trade session.
Sourcepub fn sender_comp_id(&self) -> &str
pub fn sender_comp_id(&self) -> &str
Returns the identifier the client sends as its sender (49).
Sourcepub fn target_comp_id(&self) -> &str
pub fn target_comp_id(&self) -> &str
Returns the identifier of the server (56).
Sourcepub const fn password(&self) -> &FixPassword
pub const fn password(&self) -> &FixPassword
Returns the password of the sessions (554).
Sourcepub const fn timeout(&self) -> Duration
pub const fn timeout(&self) -> Duration
Returns the time allowed for an answer of the server and for a write.
Sourcepub const fn reconnect_delay(&self) -> Duration
pub const fn reconnect_delay(&self) -> Duration
Returns the reconnect delay: the pause before the first attempt to open a lost session again. The pause before the n-th attempt is n times as long.