pub struct UpdateConfigBuilder<'a, C> { /* private fields */ }Expand description
Fluent builder for editing TWS/Gateway configuration.
Set only the groups you want to change; unset groups are left untouched by
the gateway. Terminate with submit. Obtain one from
Client::update_config.
Implementations§
Source§impl<'a, C> UpdateConfigBuilder<'a, C>
impl<'a, C> UpdateConfigBuilder<'a, C>
Sourcepub fn api(self, api: ApiConfig) -> Self
pub fn api(self, api: ApiConfig) -> Self
Edit the API-level configuration (precautions and/or settings).
Sourcepub fn orders(self, orders: OrdersConfig) -> Self
pub fn orders(self, orders: OrdersConfig) -> Self
Edit the order-handling configuration.
Sourcepub fn lock_and_exit(self, lock_and_exit: LockAndExit) -> Self
pub fn lock_and_exit(self, lock_and_exit: LockAndExit) -> Self
Edit the lock-and-exit (auto-logoff) settings.
Sourcepub fn message(self, message: MessageSetting) -> Self
pub fn message(self, message: MessageSetting) -> Self
Add a message-prompt edit. Call repeatedly to edit multiple prompts.
Sourcepub fn messages(
self,
messages: impl IntoIterator<Item = MessageSetting>,
) -> Self
pub fn messages( self, messages: impl IntoIterator<Item = MessageSetting>, ) -> Self
Add several message-prompt edits at once (appends). Convenient for
replaying a Config::messages snapshot.
Sourcepub fn accept_warning(self, warning: ConfigWarning) -> Self
pub fn accept_warning(self, warning: ConfigWarning) -> Self
Acknowledge a warning from a prior UpdateConfigResponse
so the gateway applies the edit on re-submission. Call once per warning.
Sourcepub fn accept_warnings(
self,
warnings: impl IntoIterator<Item = ConfigWarning>,
) -> Self
pub fn accept_warnings( self, warnings: impl IntoIterator<Item = ConfigWarning>, ) -> Self
Acknowledge several warnings at once (appends). Convenient for echoing a
prior UpdateConfigResponse::warnings
in one call before re-submitting.
Sourcepub fn reset_api_order_sequence(self) -> Self
pub fn reset_api_order_sequence(self) -> Self
Request that the gateway reset the API order-id sequence.
Source§impl UpdateConfigBuilder<'_, Client>
impl UpdateConfigBuilder<'_, Client>
Sourcepub fn submit(self) -> Result<UpdateConfigResponse, Error>
pub fn submit(self) -> Result<UpdateConfigResponse, Error>
Submit the configuration edit synchronously.
Returns the gateway’s UpdateConfigResponse. If its warnings are
non-empty the edit was not applied — re-submit with each warning passed
to accept_warning.
§Examples
use ibapi::client::blocking::Client;
use ibapi::config::{ApiConfig, ApiSettings};
let client = Client::connect("127.0.0.1:4002", 100).expect("connection failed");
let response = client
.update_config()
.api(ApiConfig {
settings: Some(ApiSettings {
socket_port: Some(7497),
..Default::default()
}),
..Default::default()
})
.submit()
.expect("update config failed");
println!("{response:?}");Source§impl UpdateConfigBuilder<'_, Client>
impl UpdateConfigBuilder<'_, Client>
Sourcepub async fn submit(self) -> Result<UpdateConfigResponse, Error>
pub async fn submit(self) -> Result<UpdateConfigResponse, Error>
Submit the configuration edit asynchronously.
Returns the gateway’s UpdateConfigResponse. If its warnings are
non-empty the edit was not applied — re-submit with each warning passed
to accept_warning.
§Examples
use ibapi::prelude::*;
use ibapi::config::{ApiConfig, ApiSettings};
#[tokio::main]
async fn main() {
let client = Client::connect("127.0.0.1:4002", 100).await.expect("connection failed");
let response = client
.update_config()
.api(ApiConfig {
settings: Some(ApiSettings {
socket_port: Some(7497),
..Default::default()
}),
..Default::default()
})
.submit()
.await
.expect("update config failed");
println!("{response:?}");
}