Skip to main content

UpdateConfigBuilder

Struct UpdateConfigBuilder 

Source
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>

Source

pub fn api(self, api: ApiConfig) -> Self

Edit the API-level configuration (precautions and/or settings).

Source

pub fn orders(self, orders: OrdersConfig) -> Self

Edit the order-handling configuration.

Source

pub fn lock_and_exit(self, lock_and_exit: LockAndExit) -> Self

Edit the lock-and-exit (auto-logoff) settings.

Source

pub fn message(self, message: MessageSetting) -> Self

Add a message-prompt edit. Call repeatedly to edit multiple prompts.

Source

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.

Source

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.

Source

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.

Source

pub fn reset_api_order_sequence(self) -> Self

Request that the gateway reset the API order-id sequence.

Source§

impl UpdateConfigBuilder<'_, Client>

Source

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>

Source

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:?}");
}

Auto Trait Implementations§

§

impl<'a, C> Freeze for UpdateConfigBuilder<'a, C>
where &'a C: Freeze,

§

impl<'a, C> RefUnwindSafe for UpdateConfigBuilder<'a, C>

§

impl<'a, C> Send for UpdateConfigBuilder<'a, C>
where &'a C: Send,

§

impl<'a, C> Sync for UpdateConfigBuilder<'a, C>
where &'a C: Sync,

§

impl<'a, C> Unpin for UpdateConfigBuilder<'a, C>
where &'a C: Unpin,

§

impl<'a, C> UnsafeUnpin for UpdateConfigBuilder<'a, C>

§

impl<'a, C> UnwindSafe for UpdateConfigBuilder<'a, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.